onSubmit client script submission should wait till the UI page selection/submission.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-06-2018 06:54 AM
Hello,
We have a onSubmit client script which calls a UI page(slushbucket) for selection of groups to be added in approvals.
The issue we are facing is, when user submits the form, the client script runs and the UI page is shown. But before user can select the groups and click OK, the form gets saved and group selection is not captured.
Already tried with return to FALSE, but in this scenario the modifications on the form will not be taken into consideration even the approvals records are added.
Here is the sample of the code.
var ans = confirm("Please confirm if you want to add additional approvers");
if(ans == false){
return false;
}else{
var dialog = new GlideDialogWindow('somename');
dialog.setTitle('Select additional approvals');
dialog.setSize(500,500);
dialog.render();
}
}
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-06-2018 07:06 AM
Hi,
Try this
var dialog = new GlideDialogWindow('somename');
dialog.setTitle('Select additional approvals');
dialog.setSize(500,500);
dialog.render();
return false;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-06-2018 07:16 AM
Anurag, we have tried this. As described above, the form doesn't take new modifications on form into consideration.
Ex. We change state from 'opened' to 'in-progress' and save. Post client script runs, the form will have state as opened only.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-06-2018 07:20 AM
Hi,
Create a one new Submit button called Submit and do not include update functionality into it.once you click this button the button should be hidden and dialogue window will appear since you are not including update() function the form will not get close.after selecting approval group use second submit button and submit the form.
Note:Submit button 1 Contains no update function and will be hidden after first click or once the dialogue window apears.
Submit button 2 contains update function and after Selecting group if you click on submit the form will take the group value and it will get submit.
Try this and let me know if it work.
Mark HelpFull if you get this correct.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2018 03:06 AM
Hello,
My requirement is to add the approvers on save of the form. But if we change the script of save/submit button, this will impact other functionalities.