February 2018
Intermediate to advanced
226 pages
5h 13m
English
Now that we have seen the client aspect of an AJAX call, let's have a look at the the server-side code that is required to make this work.
As mentioned before, we need to call the script include the same name as our AJAX call and make sure it contains a function with the name in the sysparm_name parameter. We also need to ensure we make the script include the client callable for the AJAX call to work, and we can do this by checking the client callable tick box on the script include:
var serverAjax = Class.create();serverAjax.prototype = Object.extendsObject(AbstractAjaxProcessor, { getUserLocation: function getUserLocation() { var userRecord = new GlideRecord('sys_user'); userRecord.get(this.getParameter('sysparm_user_id')); ...Read now
Unlock full access