GlideAjax - Client Callable Script Include

  Рет қаралды 5,562

TechWithPri

TechWithPri

Күн бұрын

Пікірлер: 13
@LaurentKalemera
@LaurentKalemera Ай бұрын
Hi @TechWithPri, could you please explain the use of keyword 'this' on the "user" variable, line 5? I know 'this' method connects variables of an object in a function, but in this case I am failing to connect the dots on how 'this' comes into place in this case. Thank you
@techwithpri
@techwithpri Ай бұрын
Hey 👋 When a client callable script include is called from a client script or business rule, a new instance of the script include is created. The this keyword refers to that specific instance, allowing you to access its properties and methods.
@vasukismile1839
@vasukismile1839 Жыл бұрын
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 Жыл бұрын
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 😃😃
@pandulavenkatajay
@pandulavenkatajay Жыл бұрын
bro you did not mention how to stop the giving the role while we saving the client callable script include
@techwithpri
@techwithpri Жыл бұрын
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 !!
@ANINDYASUNDARHAZRA
@ANINDYASUNDARHAZRA 7 ай бұрын
Can we call a client callable script include from background script?
@techwithpri
@techwithpri 7 ай бұрын
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
@avia-rw6cy
@avia-rw6cy 8 ай бұрын
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 8 ай бұрын
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
@nikhil.kamlekar7398
@nikhil.kamlekar7398 3 ай бұрын
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 2 ай бұрын
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() 🤓
Return Multiple Values from Script Include (JSON Object)
22:59
TechWithPri
Рет қаралды 3,6 М.
On Demand/Classless Script Include (with use case)
15:03
TechWithPri
Рет қаралды 4,7 М.
Every team from the Bracket Buster! Who ya got? 😏
0:53
FailArmy Shorts
Рет қаралды 13 МЛН
Air Sigma Girl #sigma
0:32
Jin and Hattie
Рет қаралды 45 МЛН
Какой я клей? | CLEX #shorts
0:59
CLEX
Рет қаралды 1,9 МЛН
Domain-Driven Design: The Last Explanation You'll Ever Need
21:05
Software Developer Diaries
Рет қаралды 18 М.
15 Interview questions on Client Scripts in ServiceNow
24:37
Hardit Singh
Рет қаралды 2,9 М.
What is Script Include?
16:49
TechWithPri
Рет қаралды 6 М.
Explore ServiceNow API
17:55
TechWithPri
Рет қаралды 15 М.
GlideSystem
19:39
TechWithPri
Рет қаралды 8 М.
Script Include and GlideAjax ServiceNow Coding Demo with Examples | ServiceNow GlideAjax
20:50
Define a new Class Script Include (use case)
30:04
TechWithPri
Рет қаралды 4,9 М.
Script Include Explain part 1 #servicenow
22:40
SKFacts and ITCareers
Рет қаралды 7 М.