How to add more condition to show up "Add" button in a related list
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2023 02:47 AM - edited 09-13-2023 02:48 AM
This button is not visible in related list - Risks in control form when there is no record with the selected entity. The requirement is - it should remain visible when parent.getDisplayValue('profile.profile_class') == "Facility". I wanted to add this in "Condition" but Condition length is less due to which this condition cannot be added.
Is there any other way I can complete this requirement?
Pls help me on this.
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2023 02:56 AM
then do this
1) create a normal script include and call it from the condition field and pass the parent object
new ScriptInclude().functionName(parent)
2) inside the script include function handle the condition logic and return true/false
If my response helped please mark it correct and close the thread so that it benefits future readers.
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-13-2023 04:02 AM
I added " || new sn_grc.ClassA().getCls(parent)" in condition and created below script include -
The "Add" button is visible to other entity classes also.
Can you pls check, where I am missing?