what is glide ajax syntax?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-24-2017 09:32 PM
werty

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-24-2017 09:35 PM
Hi
If you want to do any validations on server side, you will have to use GlideAjax from a client script and pass the information to a script include and perform the server side validations and return a value to the client side

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-24-2017 10:03 PM
This will help you to understand
what is GlideAjax ?How to write Ajax function? | Ahmed Drar
SN Pro Tips — GlideRecord & GlideAjax: Client-Side Vs. Server-Side
Harish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-24-2017 10:07 PM
Hi rajasekhar,
Asynchronous Glide Ajax
var ga = new GlideAjax('className');
ga.addParam('sysparm_name','myfunction_name');
ga.addParam('sysparm_user_name',"parameter1");
ga.getXML(HelloWorldParse);
A callback function :
function HelloWorldParse(response) {
var answer = response.responseXML.documentElement.getAttribute("answer");
alert(answer);
}
For more details please visit

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-14-2017 01:51 AM
Hi Raja,
Good Day
Please find the below brief information about the GlideAjax for your reference.
GLIDEAJAX :
The GlideAjax class is used by client-side scripts to send data to and receive data from the ServiceNow server. The client-side script passes parameters to the Script Include. The Script Include returns data as XML or a JSON object. The client-side script parses data from the response and can use the data in subsequent script logic.
Script Include for Retrieving an Email Address
The Script Include must be client callable because it will be used by client-side scripts.
The AbstractAjaxProcessor class is part of the Global Scope. The GetEmailAddress Script Include is in the NeedIt scope. To extend the AbstractAjaxProcessor, the class must be prepended by the scope: global.AbstractAjaxProcessor. The new class defines a method called getEmail.
The syntax this.getParameter('sysparm_<parameter_name>') means to get the value of the parameter passed in from the client-side script. In this example, sysparm_userID contains the sys_id of a User table record.
Client-side Script for Using the GetEmailAddress Script Include
Any in-scope client-side script can use Script Includes which extend the AbstractAjax Processor. The generalized syntax is:
The first call to addParam() should be for the parameter sysparm_name and should pass as the value the name of the server-side method you want to call. Use addParam to pass user-defined parameters starting with sysparm_ and their values. Users can create their own sysparm_ variables except sysparm_name, sysparm_type, sysparm_function and sysparm_value.
The getXML method sends the server a request to execute the method and parameters associated with this GlideAjax object. The server processes the request asynchronously and returns the results via the function specified as the callback function. This example, which uses a callback function, is asynchronous meaning that the user's screen is not frozen while the script waits for a response to come back from the server. Asynchronous GlideAjax is recommended over synchronous.
The callback function is passed the response back from the server. The script logic extracts the return value from the response. Subsequent script logic can use the extracted value.
Here is the client-side logic for using the GetEmailAddress Script Include:
Please mark it as correct/helpful/like based on the impact if the response.
Thanks,
Priyanka R