
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2019 11:22 PM
Dear SNC
I want to avoid multiple scripts, thats why I want to code if(serviceportal)...in client script
any help is highly appreciated
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2019 11:28 PM
Hi,
Here is an official documentation from SN on how to separate a script for portal and platform execution.
Checking desktop vs mobile runtime
if (window === null) // Write your mobile or service portal compatible code here else // Write your desktop compatible code here

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2019 11:24 PM
Hi
If(window === null) will return you true if it is on the Native Ui and not portal. It's else {} would indicate that it is Service Portal.
Hope this helps.
Regards,
Omkar Mone
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2019 11:28 PM
Hi,
Here is an official documentation from SN on how to separate a script for portal and platform execution.
Checking desktop vs mobile runtime
if (window === null) // Write your mobile or service portal compatible code here else // Write your desktop compatible code here