GlideModal - processing script not executed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2018 01:06 PM
Hi community,
I am in a scoped application.
When I click on my UI Action, I have a popup which displays a UI Page which displays a Reference field :
But when I select something and clicks 'OK', the 'processing script' of the UI Page is not executed.
The important thing is that I use a GlideModal.
Note that the processing script executes if I use a GlideDialogWindow or a GlideModalForm....
See my UI Page code below :
HTML
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<style type="text/css">
div {
margin: 5px 20px 5px 20px;
}
.buttons {
margin-top: 15px;
text-align: right;
}
</style>
<g:ui_form>
<div>
<g:ui_reference name="businessSector" id="businessSector" table="x_desgr_gcourr_secteurs_d_affaires"/>
</div>
<div class="buttons">
<g:dialog_buttons_ok_cancel ok="return onSubmit();" cancel="return onCancel();"/>
</div>
</g:ui_form>
</j:jelly>
Client script
function onCancel() {
GlideModal.get().destroy();
return false;
}
function onSubmit() {
var businessSectorSelected = gel("businessSector").value;
GlideModal.get().destroy();
return true;
}
Processing script
gs.info('processing script');
Do you know why it doesn't execute ?
Do you have a work-around ?
Alexis
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2018 05:56 AM
Anyone has encounter this problem ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-13-2018 06:29 AM
Is this fixed in London ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2019 11:16 AM
It's because you are destroying your GlideModal before you are returning true. You don't need to do this if you are using the processing script, you just need to use the response.sendRedirect([URL]) to put the user where you want them to be after they've submitted your page, the GlideModal will automatically be destroyed. Alternatively you could use a GlideAjax call in your client script to call the server side processing.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2020 09:05 AM
Can you refer the below link
https://community.servicenow.com/community?id=community_question&sys_id=904e4111db539380b2102926ca961922