- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-05-2017 04:09 PM
Hi,
I have UI page on approval record when the state change to approved and click on update we are displaying this UI page and if user click on accept it is changing to state to approved but it is asking for reload the page to save changes. Here are my client script and UI page
Client Script:
function onSubmit() {
//confirm Pop Up Window
if( g_form.getValue('state')=='approved'){
var ga = new GlideAjax('approveChange');
ga.addParam('sysparm_name','checkCABApproval');
ga.addParam('sysparm_approverID',g_form.getUniqueValue());
ga.getXMLWait();
var answer = ga.getAnswer().toString();
//alert(answer);
if(answer == false || answer == 'false') {
g_form.setValue('state', 'approved');
//g_form.submit();
}
if(answer == true || answer == 'true') {
var gd = new GlideDialogWindow('confirmation_page');
gd.setTitle('Accept terms and conditions');
gd.setPreference('approval_sys_id', g_form.getUniqueValue());
gd.render();
return false;
}
}
Can anyone help me to refresh the UI page after i click on accept button?
Thanks,
Chaitanya
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-05-2017 05:23 PM
Hello Chaitanya,
I believe the function you are looking for is: gsftSubmit(document.getElementById('sysverb_update_and_stay'));
You can add the function before opening the Dialog or in the UI Page in the function that gets called when the user presses "OK". Check the following link for an example: GlideDialogWindow: Advanced Popups Using UI Pages - ServiceNow Guru
Best of luck,
Jorge
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-05-2017 05:23 PM
Hello Chaitanya,
I believe the function you are looking for is: gsftSubmit(document.getElementById('sysverb_update_and_stay'));
You can add the function before opening the Dialog or in the UI Page in the function that gets called when the user presses "OK". Check the following link for an example: GlideDialogWindow: Advanced Popups Using UI Pages - ServiceNow Guru
Best of luck,
Jorge
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-06-2017 09:53 AM
I am not doing this from UI action. I am changing the state to approved and clicked on update then i got this UI page and reload message. The above functions is works for UI action
Thanks,
Chaitanya