How to call script include from UI Page client script section ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-16-2018 02:50 AM
Hello,
I need to make a call to script include from UI Page, when i try to invoke a function from client script of UI Page, it is not returning me anything, where as same thing works from catalog client script. please find the code snippet below.
$(document).ready(function() {
var ga = new GlideAjax("ControlVirtualMachinesAjax");
ga.addParam("sysparm_name", "getVMSInRG");
ga.getXML(ajaxResponse);
function ajaxResponse(serverResponse) {
alert("ServerResponse: " + serverResponse);
}
});
Same code works perfect from catalog client script but not from client script of UI Page. In the above code , control never comes inside ajaxResponse method.
Thanks,
Krishna P
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-16-2018 04:02 AM
Go to script includes and search for ControlVirtualMachinesAjax record. On the record, you can see Client callable checkbox.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-16-2018 04:00 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-16-2018 04:08 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-16-2018 04:42 AM
Is your UI page in same application scope i.e. x_fisg2_scope.
If not, please change the accessible from value to all application scope.
Thanks
Gaurav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-16-2018 05:34 AM
yes, my UI page is in the same scope as script include. and i have tried changing the accessible from value to All application scope, but none worked.
script include scope is - x_fisg2_scope.ControlVirtualMachinesAjax
up page endpoint is - x_fisg2_scope_VM List Page.do