Notifications

9 views

Scenario

In case users want to setupt client scripts to run both in Desktop and Service Portal, but in the same script differenciate between each another

 

According to the following documentation, you can use the script:

  if (window === null)
    // Write your mobile compatible code here
  else
    // Write your desktop compatible code here

According

However, this will only work in case the following property is set:

 

glide.script.block.client.globals 

type TRUE/FALSE

value false

 

Keep in mind that this will not work within scoped applications as documented in KB0719258

The following community thread may be helpful  in such cases: 

Scoped Applications and Client Scripts: A Primer 
https://community.servicenow.com/community?id=community_blog&sys_id=788c66e1dbd0dbc01dcaf3231f961969 

Article Information

Last Updated:2019-03-18 02:43:29
Published:2019-03-18