Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

Use script include in a condition field Help

yoli1
Tera Contributor
Hello Team  
how can i transfer my condition to a script include and then calling the script include from the condition Field
 
10 REPLIES 10

JimMarciano
Tera Contributor

Hi Yoli1,

 

you need to instance your script include using the command new.
Try it:

!new ListProperties().isRelatedList() && !new ListProperties().isRefList() && (new ListProperties().getTable() != "sys_user" || gs.hasRole("admin"))

I recommend you to join all the ListProperties conditions in one single function in your script include and execute just a single script include execution.

If you think my answers are useful for you, I would appreciate it if you could mark my answers as helpful. 


Best regards,

Jim

HI @JimMarciano this is what i did but it doesn't work can you please help

2H.PNG1h.PNG

remove the list from the parameter of the function.

add between the lines 3 and 4, the command:
var list = new ListProperties();

On condition field must be:
new test().yes()

The function name that you created is yes.

If you think my answers are useful for you, I would appreciate it if you could mark my answers as helpful. 


Best regards,

Jim

@JimMarciano Still dosent work

2HH.PNG1HH.PNG