logo

NJP

How to call a SCRIPT INCLUDE in UI ACTION - Client side

Import · Oct 12, 2020 · article

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:

image

View original source

https://www.servicenow.com/community/developer-articles/how-to-call-a-script-include-in-ui-action-client-side/ta-p/2320839