GlideAjax - Client Callable Script Include

  Рет қаралды 4,043

TechWithPri

TechWithPri

Күн бұрын

Пікірлер: 11
@vasukismile1839
@vasukismile1839 10 ай бұрын
Just a query. Why we should avoid reference function completely? Shall we use call back reference function ? That will not affect the performance. That is asynchronous too.
@techwithpri
@techwithpri 10 ай бұрын
Hey !! Yes its true that its asynchronous and also callback function is present but getReference returns the entire record back when doing lookups, on the other hand GlideAjax script only return the necessary information which you are looking for. So GlideAjax is always a best choice 😃😃
@avia-rw6cy
@avia-rw6cy 5 ай бұрын
Hello Sir, Please post some scenarios regarding calling of script includes in catalog client scripts, would be very much helpful. Thanking you in advance sir..
@techwithpri
@techwithpri 5 ай бұрын
Hey Thank you for your comment !! I will surely do that in my complex use case video for ServiceNow. To get access on more use case join my channel now - kzbin.info/door/q9dV0PMEdQFzD4JTCNfK3Ajoin
@pandulavenkatajay
@pandulavenkatajay 10 ай бұрын
bro you did not mention how to stop the giving the role while we saving the client callable script include
@techwithpri
@techwithpri 10 ай бұрын
Hi Bro! Thank you for highlighting !! I searched this a lot but what I found is this by default can't be turn off however there is a way to solve this. Please find the link where you can find the detail - www.servicenow.com/community/now-platform-articles/privacy-on-client-callable-script-includes-instance-security/ta-p/2386648 Let me know for any concern !!
@nikhil.kamlekar7398
@nikhil.kamlekar7398 11 күн бұрын
Hey Pritam, I followed the steps mentioned by you but it's not working. Here is my Client Script: function onChange(control, oldValue, newValue, isLoading, isTemplate) { if (isLoading || newValue === '') { return; } //Type appropriate comment here, and begin script below var callerVar=new GlideAjax('getEmail'); callerVar.addParam('sys_param_name','getEmail'); callerVar.addParam('sys_param_get_user_details',g_form.getValue()); callerVar.getXML(emailDetails); function emailDetails(response){ var emailId=response.responseXML.documentElement.getAttribute('answer'); g_form.setValue('u_email',emailId); } } Script Includes: var getEmail = Class.create(); getEmail.prototype = Object.extendsObject(AbstractAjaxProcessor, { getEmail: function() { var user = this.getParameter('sys_param_get_user_details'); // Added quotes around parameter name var gRecord = new GlideRecord('sys_user'); gRecord.addQuery('sys_id', user); gRecord.query(); if (gRecord.next()) { return gRecord.email; // to return the email field from the GlideRecord } return ''; // Return an empty string if no user is found } }); Could you please review, and help me out?
@techwithpri
@techwithpri 5 күн бұрын
Hey 👋 Sorry for the late reply 😔 Please check the - callerVar.addParam('sys_param_get_user_details',g_form.getValue()); You supposed to put the field name inside of g_form.getValue() 🤓
@ANINDYASUNDARHAZRA
@ANINDYASUNDARHAZRA 4 ай бұрын
Can we call a client callable script include from background script?
@techwithpri
@techwithpri 4 ай бұрын
Yes it can. Follow the below link to check it further - www.servicenow.com/community/developer-forum/how-to-execute-client-callable-script-include-in-background/m-p/2528806
Return Multiple Values from Script Include (JSON Object)
22:59
TechWithPri
Рет қаралды 2,8 М.
Define a new Class Script Include (use case)
30:04
TechWithPri
Рет қаралды 3,6 М.
Smart Sigma Kid #funny #sigma
00:14
CRAZY GREAPA
Рет қаралды 84 МЛН
Человек паук уже не тот
00:32
Miracle
Рет қаралды 1,6 МЛН
ServiceNow GlideUser (g_user) API
16:26
TechWithPri
Рет қаралды 3,5 М.
ServiceNow Business Rules
24:29
TechWithPri
Рет қаралды 15 М.
Access server data from client (g_scratchpad)
21:06
TechWithPri
Рет қаралды 4,2 М.
getReference ( no callback) vs getReference (callback)
14:32
TechWithPri
Рет қаралды 3,1 М.
Explore ServiceNow API
17:55
TechWithPri
Рет қаралды 10 М.
3 use cases of Business Rules
26:57
TechWithPri
Рет қаралды 4,5 М.
What is Script Include?
16:49
TechWithPri
Рет қаралды 4,5 М.
3 Use Cases of UI Actions
28:51
TechWithPri
Рет қаралды 3,4 М.
GlideAjax Tutorial | ServiceNow (Live Coding)
19:29
Hardit Singh
Рет қаралды 6 М.