- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-25-2017 09:01 PM
Hi All ,
Please help with this requirement . I have created catalog Onchange client script to verify the computer name entered by the user on the catalog form. I am making GlideAjax to a script include which inturn will be calling the Powershell script .I am making Synchronous Ajax call so user need to wait for result whether Computer name entered is Valid AD object or not.
The issue I am facing is Once change is made to the Computer name variable , the dialog window is showing as loading but Immediately it comes as "Page not found" shown below . Please help me what changes I need to make to the On Change Catalog client script.
Onchange Catalog Client script:
------------------------------------------
function onChange(control, oldValue, newValue, isLoading) {
if (newValue != '') {
var loadingDialog = new GlideDialogWindow("dialog_loading", true);
loadingDialog.setTitle('Please wait,your computer name is getting verified'); //Set the loading dialog title here...
loadingDialog.render();
var cuser = g_form.getValue('requestor');
//alert(cuser);
var userAjax = new GlideAjax('GenericAJAXUtil');
userAjax.addParam('sysparm_name', 'getUSerDomain');
userAjax.addParam('sysparm_user',cuser);
userAjax.getXML(function(response){
var resp = response.responseXML.documentElement.getAttribute('answer');
//alert(resp);
var cAjax = new GlideAjax('ValidateComputerUtil');
cAjax.addParam('sysparm_name', 'checkcomputer');
cAjax.addParam('sysparm_value1', newValue );
cAjax.addParam('sysparm_value2', resp);
cAjax.getXMLWait();
alert(cAjax.getAnswer().output);
loadingDialog.destroy();
});
}
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-25-2017 10:14 PM
There seems to be some issue with loading_dialog macro as well. Its mentioned that its no longer working after fuji release. Below thread seems to have a code from UI Macro which can be used ti create a new UI page and then it should work when you pass the ui page name in the GlideDialoWindow.
Re: Show/Hide Loading Dialog on shopping cart submit
Above should help you to fix the page not found error but further you need to work on your code to get it working properly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-25-2017 10:14 PM
There seems to be some issue with loading_dialog macro as well. Its mentioned that its no longer working after fuji release. Below thread seems to have a code from UI Macro which can be used ti create a new UI page and then it should work when you pass the ui page name in the GlideDialoWindow.
Re: Show/Hide Loading Dialog on shopping cart submit
Above should help you to fix the page not found error but further you need to work on your code to get it working properly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-25-2017 10:35 PM
Hi Gurpreet,
I tried with the below script as per the link you provided , it is still displaying the same error.
We are on Istanbul version . I do not find this UI macro in our system. Please suggest.
function onChange(control, oldValue, newValue, isLoading) {
if (newValue != '') {
var loadingDialog = new GlideDialogWindow('form_loading_dialog');
loadingDialog.setTitle('Please wait,your computer name is getting verified');
loadingDialog.render();
var cuser = g_form.getValue('requestor');
var userAjax = new GlideAjax('GenericAJAXUtil');
userAjax.addParam('sysparm_name', 'getUSerDomain');
userAjax.addParam('sysparm_user',cuser);
userAjax.getXML(function(response){
var resp = response.responseXML.documentElement.getAttribute('answer');
//alert(resp);
var cAjax = new GlideAjax('ValidateComputerUtil');
cAjax.addParam('sysparm_name', 'checkcomputer');
cAjax.addParam('sysparm_value1', newValue );
cAjax.addParam('sysparm_value2', resp);
cAjax.getXMLWait();
alert(cAjax.getAnswer().output);
loadingDialog.destroy();
});
}
}