Why setDisplay() method is not working?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-08-2020 12:58 AM
The below client script is for service portal in which setDisplay() method is not working.
Could anyone please help?
Thanks,
Ankita
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-08-2020 01:02 AM
Hi Ankita,
Are you getting the alert correctly? If so, can you ensure the Isolate script field on the Client script is set to False. It is True by default.
It may not be available on the form you can add it to the form or update the same from List View.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-08-2020 01:07 AM
Hi Ankita,
Few things to check
1) is that variable name correct u_source and u_new_source
2) Is alert coming for if or else
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-08-2020 09:49 PM
Hi Ankur,
Yes the both points that you have mentioned are working fine.But still script is not working.
Thanks,
Ankita
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-08-2020 01:12 AM
SetDisplay is not supported in Mobile/Portal.
Use:
g_form.setVisible(fieldName, isVisible)