New button needs to be disable for group 'A-Fulfillers', for a customer table created.

LVPhanee
Tera Contributor

I have a requirement like 

''

in catalog tasks when we click on the SCTASK it will open form. in form we have a related list for custom create table 'metals tasks' requirement : when sctask state is 'completed' or 'cancelled' then for Fulfiller group New button should not appear.

''

can anyone guide me how to write a UI Action for this? Is UI Action the best one or suggest another. 

5 REPLIES 5

Tanushree Maiti
Tera Patron

Hi @LVPhanee 

 

Try this:

 

Option 1: Update list Control for Metal Task Related list

  • Navigate to your form and view the Metals Tasks related list.
  • Right-click any column header in the related list and select List Control
  • Check the box for Omit new button
  • To make this conditional, find the Omit new condition field and click the lock/edit icon. 
  • Write a condition

                answer = parent.state == 3 || parent.state == 4;

 

option2:

  • Navigate to your form and view the Metals Tasks related list.
  • Right-click any column header in the related list and select List Control
  • Check the box for Omit new button
  • To make this conditional, find the Omit new condition field, click the advanced script icon

 

answer = false;

var sctaskState = parent.state;

if (sctaskState == 3 || sctaskState == 4) // Check if SCTASK is Closed Complete (3) or Closed Canceled (4)

{

      var isFulfiller = gs.getUser().isMemberOf('Fulfiller_Group_Name_or_SysID'); //Replace with Actual sys_id

        if (isFulfiller) {

        answer = true;

    }

}

 

 

Please Accept the solution if it assisted you with your question & Mark this response as Helpful.
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti