Show only ‘New’ button on the ‘Task’ related list, show it only to caller and 'itil' role user.

Tejas16
Tera Contributor

Show only ‘New’ button on the ‘Task’ related list, show it only to caller and "itil" role
user in the "in progress" state and do not show ‘Edit’ button on incident form.

 

How we can do above scenario?

Is it possible using List Control->omit new Condition?

1 ACCEPTED SOLUTION

@Tejas16 

1) right click List control in related list

In the omit new condition script add this

give the correct field name for caller from parent form

if(parent.callerField == gs.getUserID() && gs.hasRole('itil'))
	answer = false;
else
	answer = true;

Similarly add script for Omit edit as per your requirement

AnkurBawiskar_0-1673357500193.png

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

View solution in original post

8 REPLIES 8

@Tejas16 

so you created a defined relationship between those

what script did you start writing in the Omit Edit script in list control?

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

Now I have defined a field which is refering to parent table(Training ).

 

I have not started to script till now, please guide me accordingly.

@Tejas16 

1) right click List control in related list

In the omit new condition script add this

give the correct field name for caller from parent form

if(parent.callerField == gs.getUserID() && gs.hasRole('itil'))
	answer = false;
else
	answer = true;

Similarly add script for Omit edit as per your requirement

AnkurBawiskar_0-1673357500193.png

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

Do we need to check for state=="in progress" for above scenario ?