- Post History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
on 10-12-2020 01:00 PM
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 purpose
type: '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 name
foo.getXMLAnswer(function(tobeused) { // "tobeused"- name a variable to catch the response
alert('SCRIPT INCLUDE RETURN IS ' + tobeused); // alert opens a pop-up
});
- 6,451 Views
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
How can I use the coding in UI Action condition?
I created an Include Script what return true or false, then the UI Action button only showed and executed if the answer is true.
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hi, Sandro Calado.
UI Action condition field is server side. It means you can use the script include directly like "new global.BotaoDeletar().testing()" - you still can use the "current" if needed, like "new global.BotaoDeletar().testing(current)".
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hi Ram_n Botelho, thanks for your answer it's very functional and solve my doubt.