- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-05-2023 06:37 PM
Hello all,
I have a scoped application and I have developed a page using UI builder. On a button click I need to download a file from Attachments. I have added a event handler to a Page script to fetch attachment sysid. Now I just need to use window.open to download the file using the '/sys_attachment.do?sys_id=someid' URL. Issue is that window is undefined in the UI builder page scripts. I even tried setting the glide.script.block.client.globals as per this KB0551586 to no avail. What am I missing? Is there an alternative to using window.open?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-12-2023 12:32 AM
Hi murtuzababuji,
I've been able to use the solution in this community post: https://www.servicenow.com/community/developer-forum/is-it-possible-to-get-dom-element-via-client-sc... in order to access the window object in page scripts.
Hope this helps!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-12-2023 12:32 AM
Hi murtuzababuji,
I've been able to use the solution in this community post: https://www.servicenow.com/community/developer-forum/is-it-possible-to-get-dom-element-via-client-sc... in order to access the window object in page scripts.
Hope this helps!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-12-2023 09:44 AM
This worked perfectly. Thanks a lot.