Refresh the form after adding attachments
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-14-2016 06:19 AM
Hi,
I attach a documents to a record by clicking the attachment icon. When I close the attachment dialog, I want the form to be reloaded.
Is that possible?
Why I need that: There is a BR on sys_attachment table, which creates some records on the related list of the form which I have open. And only when the form is reloaded, those records in the related list are visible. So, I want the user to know that something is added in the related list when he closes the attachment dialog. That's why a reload of form is needed.
Thanks in advance for your help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-14-2016 10:03 AM
Hi,
I haven't tried this with attachments, but you could try putting a gs.setRedirect GlideSystem - ServiceNow Wiki in your customised business rule.
Kind regards,
Simon
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-14-2016 11:30 AM
You can modify the existing attachment macro in such a way, when you close the attachment dialog window, the previous url in the stack will refresh like force refresh.
Its implemented in many javascript applications like closing the dialog window will refresh the parent url -
The attachment macro will be in the below url -
Hope it is helpful, feedback is appreciated
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-15-2016 03:05 AM
Hi Srikanth,
Thanks for the response.
I see that the UI Page called 'attachment' has to be modified. sys_ui_page.do?sys_id=b1b390890a0a0b1e00f6ae8a31ee2697
Here, I want "reloadWindow(window);" to be executed on 'beforeunload' event.
But I want the client script of the UI page to listen to the 'beforeunload' event.
I tried adding the following lines, but it is not listening.... Any idea how to get it working?
Event.observe( window, 'beforeunload', reloadParentForm); // doesn't work
Event.observe( GlideDialogWindow.get(), 'beforeunload', reloadParentForm); // doesn't work
Event.observe( window, 'beforeunload', reloadParentForm, false); // doesn't work
function reloadParentForm() {
GlideDialogWindow.get().destroy();
reloadWindow(window);
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-23-2023 01:45 AM