- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-10-2020 12:01 AM
Hi Listers,
We are currently displaying a record producer in a modal window using ui page
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<g:evaluate var="jvar_url"
expression="RP.getWindowProperties().get('url_param')">
</g:evaluate>
<iframe id="rp_frame" src="${jvar_url}" width="800" height="600" />
</j:jelly>
The problem is that when the producer Submit button is clicked, the new created record is displayed inside the dialog window. Is there a simple way to just close the modal window after the producer is submitted?.
Thanks for your help.
Victor
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-13-2020 05:56 AM
After some investigation I finally found a solution which is not altogether perfect - but serves my purpose. The idea is to use .load() event of the iframe
var iframe = $j('#rp_frame');
iframe.load(function(){
var catItem = iframe.contents().find('#cat_item_view');
var catItemId = catItem.attr('id');
if(!catItemId){
GlideDialogWindow.get().destroy();
}
}
Regards,
Victor.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-10-2020 12:56 AM
Hi Victor,
You can simply add one more line in your record producer like,
producer.redirect="home.do";
Then it will not take you to newly created record.
Please follow below link, it may helps,
https://community.servicenow.com/community?id=community_question&sys_id=c784177f1b3efb80fff162c4bd4b...
Kindly mark the answer as Correct and Helpful if this answers your question.
Thank You.
Regards,
Geetanjali Khyale
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-13-2020 05:40 AM
Thanks for your response - but I do not want to redirect somewhere else, I want to close the modal window.
Regards,
Victor

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-13-2020 05:45 AM
Hi,
In your client script you can use: GlideDialogWindow.get().destroy();
But you'd want to trigger that only when they submit, so on button action.
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-13-2020 05:48 AM
Yes, Allen - I thought about that - the problem is that the window also closes when the from is not submitted due to some validation error.