How to call a SCRIPT INCLUDE in UI ACTION - Client side
Easy peasy resume of how to call a SCRIPT INCLUDE in UI ACTION - Client side:
Script include: > Client callable TRUE
var BotaoDeletar = Class.create();BotaoDeletar.prototype = Object.extendsObject(AbstractAjaxProcessor, {testing: function(){return 25;}, // just for testing purposetype: 'BotaoDeletar'
});
UI Action - Client side
var foo = new GlideAjax('global.BotaoDeletar'); // "scope"."script include name"foo.addParam('sysparm_name', 'testing'); // obligatory, to call the function by its namefoo.getXMLAnswer(function(tobeused) { // "tobeused"- name a variable to catch the responsealert('SCRIPT INCLUDE RETURN IS ' + tobeused); // alert opens a pop-up
});
Labels:
https://www.servicenow.com/community/developer-articles/how-to-call-a-script-include-in-ui-action-client-side/ta-p/2320839
