How to add more condition to show up "Add" button in a related list

aagman4
Tera Contributor

 

aagman4_1-1694598000471.png

aagman4_2-1694598047116.png

aagman4_3-1694598167554.png

 

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!

2 REPLIES 2

Ankur Bawiskar
Tera Patron
Tera Patron

@aagman4 

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.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

I added " || new sn_grc.ClassA().getCls(parent)" in condition and created below script include -

 

aagman4_0-1694602869316.png

The "Add" button is visible to other entity classes also.

 

Can you pls check, where I am missing?