Diable/Hide new button

adityasanap
Tera Contributor

I want to Hide/Disable new button based on status field value of case form in CSM workspace.

If status is closed new button should be hidden/disable in in CSM workspace in related list, it should not be able to create a task.

2 REPLIES 2

Ankur Bawiskar
Tera Patron

@adityasanap 

screenshot please

In which related list?

Why not check the Table.None CREATE ACL on that Related list table and it will check the state of case via the parent field?

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

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

Me Being Mustaq
Kilo Sage

Hi @adityasanap ,

 

In CSM Configurable Workspace, the related list New button is not controlled by the classic List Control (Omit New Button) settings. Instead, it is controlled by Declarative Actions (Related List Actions)

 

Hide/disable the New button on the related list when the Case State/Status = Closed, so users cannot create Tasks from the Case.
 
I will recommend , Even if the button is hidden, users may still create records through other methods (API, URL, other UI actions). Add a server-side restriction as well:
  • Create ACL on the Task table.
  • Or add a Business Rule that prevents insert when the parent Case is Closed.

Example on Business Rule condition 

if (current.parent.state == CLOSED_STATE_VALUE) {
gs.addErrorMessage('Cannot create task for a closed case.');
current.setAbortAction(true);
}
This ensures the restriction is enforced even if the UI button is bypassed.
 
For CSM Workspace specifically, the Declarative Action visibility condition is usually the cleanest approach for hiding the New button based on the parent Case status.
 
Warm Regards,
Shaik Mustaq.