window object not working in UI Action button click

rsadhula
Mega Contributor

Hi I'm trying to use window object in UI Action but getting error: Uncaught TypeError: Cannot read property 'open' of null

please don't ask me to enable this: glide.script.block.client.globals. Let me know if we have any alternate options

function print(){
window.open("https://www.google.com","_blank"); // Uncaught TypeError: Cannot read property 'open' of null
}

Thanks

 

1 ACCEPTED SOLUTION

You can either add it on your list layout of UI Actions by configuring using the gear icon for personalizing list Or Add it on your UI Action form layout by configuring from top of header. Configure -> Form Layout

View solution in original post

6 REPLIES 6

This is the recommended solution? Really?
I had the same problem and it was solved like this. But man, I find it had to call this bad usability. This is just rediculus.
At least the option should be shown on the from with a compehensive tooltip, if it is relevant like this. Otherwise this is just a measure to devastate development time in order to find this issue without any clue.

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

Try to add your UI Action in global scope and check once.

Mark Correct if this solves your issue and also mark Helpful if you find my response worthy based on the impact.
Thanks
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader