How to enable or disable “New” button in related list based on State of records in experience UI.

Rohan Madusanka
Kilo Contributor

The button "New" in related list should be enabled for users only if the status of record is in “Open” or “Need More Info” statuses. These records are in a custom table in Service Now and once the status changed to Submitted or Approval, this "New" button should be disabled.

 

find_real_file.png

1 ACCEPTED SOLUTION

Community Alums
Not applicable

Hi @Rohan Madusanka ,

Please follow and replicate the below steps but as per your required buttons :

I removed my old reaction, I did not read correct. You should look at the Related list action:

find_real_file.png

Search for the New - Interaction (in your case search for your "New" )

find_real_file.png

 

Click on advanced view:

find_real_file.png

 

Add the following to the script condition:

&& parent.sys_class_name + "" !== "sn_hr_core_case" 

find_real_file.png

update:

Insert and stay.

Set the original one to inactive.

 

Mark my answer correct & Helpful, if Applicable.

Thanks,

Sandeep

View solution in original post

6 REPLIES 6

Community Alums
Not applicable

Hi @Rohan Madusanka ,

Please follow and replicate the below steps but as per your required buttons :

I removed my old reaction, I did not read correct. You should look at the Related list action:

find_real_file.png

Search for the New - Interaction (in your case search for your "New" )

find_real_file.png

 

Click on advanced view:

find_real_file.png

 

Add the following to the script condition:

&& parent.sys_class_name + "" !== "sn_hr_core_case" 

find_real_file.png

update:

Insert and stay.

Set the original one to inactive.

 

Mark my answer correct & Helpful, if Applicable.

Thanks,

Sandeep

Community Alums
Not applicable

Hi @Rohan Madusanka ,

Any update to this ?Any follow-up required? if not

Kindly mark the answer as Correct & Helpful both such that others can get help.

Thanks,
Sandeep

@Sandeep Dutta could create duplicate UI Action with same name. but how can we write condition to check status in the condition? Couldn't find any docs or tutorial regarding conditions.

Community Alums
Not applicable

Hi @Rohan Madusanka ,

That's sounds like a another question which you need to raise .

Your original question is answered , Kindly mark the answer as Correct & Helpful both such that others can get help.

Thanks,
Sandeep