Variable section
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2024 01:50 AM
Hi All,
Variable section should visible only if incident raised through service portal but If any user raise incident through Like All-->Incident--> create new the Variable section should not visible in incident form.
I have added in Section Incident Variable Editor in incident form design and written below client script for variable read-only this is working fine but If user raised incident using All-->Incident--> create new the variable section showing empty.
g_form.setVariablesReadOnly(true);
Please suggest for this requirement.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2024 02:06 AM
Hello @ashok17 ,
You can write a client script and check if the variables are empty or not. And if they are empty you can make varible editor to hide.
Kindly mark the answer ✔️ Correct or Helpful ✔️ If it addresses your concern.
Regards,
Siddhesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2024 02:37 AM
ideally it should not be shown if your incident is not created from any record producer
If still not working then do this
1) use onLoad client script and hide it if the incident is getting created
2) check this using g_form.isNewRecord()
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2024 03:23 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2024 03:35 AM
Hello @ashok17 ,
You can hide variable section using client script if the form is new record
g_form.setSectionDisplay('section_name', false);