- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-30-2022 11:20 AM
For a Custom scoped application, inside agent workspace via a UI action, i display a g_modal.showframe
function onClick(g_form) {
var premiseId = g_form.getUniqueValue();
var rpId = 'rpid';
g_modal.showFrame({
url: 'sp?id=sc_cat_item&sys_id=' + rpId + '&referrer=' + premiseId,
title: 'Validate Premise Location',
size: 'fw',
height: 600
});
}
Opened Record producer is able to do needful. At OnSubmit() just want to close this modal window. How to achieve it, i have tried window.close(), top.window.close(), destroy etc. no luck yet.
Solved! Go to Solution.
- Labels:
-
Agent Workspace
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-01-2022 11:34 AM
Found the nifty solution --
Followed this post -
https://blog.jackthomas.io/2019/09/07/servicenow-how-to-close-record-producer-after-submission/
Essentially created a UI page in my App scope as helper for all such requirements with only window.close(); in client script.
Called in in producer script as producer.portal_redirect = "ui page end point";
This works everywhere, be standalone record producer or RP displayed inside g_modal.showframe
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-01-2022 11:34 AM
Found the nifty solution --
Followed this post -
https://blog.jackthomas.io/2019/09/07/servicenow-how-to-close-record-producer-after-submission/
Essentially created a UI page in my App scope as helper for all such requirements with only window.close(); in client script.
Called in in producer script as producer.portal_redirect = "ui page end point";
This works everywhere, be standalone record producer or RP displayed inside g_modal.showframe
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-12-2023 10:09 AM
Hi,
The link do the website doesnt work anymore. Can you please explain the solution you used?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-13-2023 11:14 AM
@Zmud follow as per the solution above or below->
1) Create a UI page in your app scope or global if need for platform. In its client script only put window.close();
This is a helper ui page which can be used everywhere for all such requirements.
2) Call it in Record producer script as
producer.portal_redirect = "ui page end point";
**ui page end point is url for your ui page exactly like setredirecturl.
Solution explanation - >
record producer scripts process server side post submit. so the last line should be set for redirection and this UI page once redirected, it loads with its client script calling it to close.