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.
@techwithpri10 ай бұрын
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-rw6cy5 ай бұрын
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..
@techwithpri5 ай бұрын
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
@pandulavenkatajay10 ай бұрын
bro you did not mention how to stop the giving the role while we saving the client callable script include
@techwithpri10 ай бұрын
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.kamlekar739811 күн бұрын
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?
@techwithpri5 күн бұрын
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() 🤓
@ANINDYASUNDARHAZRA4 ай бұрын
Can we call a client callable script include from background script?
@techwithpri4 ай бұрын
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