How to hide Save button in workspace (SOW)?

Kiran29
Tera Contributor

Hi All,

I have a Save button on the incident form in Workspace and there is a Business Rule that prevents the incident record from being inserted when certain conditions are met, and it returns a custom HTTP status error message.

When the record insertion is aborted due to this Business Rule, I would like the Save button to be hidden from the form after the user clicks it once, so the user can clearly see the error message without attempting to save again.Is there a way to hide the Save button in this scenario?

 
 

 

2 REPLIES 2

Tanushree Maiti
Kilo Patron

Hi @Kiran29 ,

 

As per screen shot , it seems , you are using before insert.

Put your error message before the abort statement.

 

gs.addErrorMessage('<Your custom error message to user>');
                current.setAbortAction(true);

 

Same abort condition( e.g if it is state related) you need to apply  in condition field of your Save UI action on the record table.

e.g Add the condition: current.state != 7  (Replace with your actual "aborted" state values /condition).

 

 

Please mark this response as Helpful & Accept it as solution if it assisted you with your question.
Regards
Tanushree Maiti
ServiceNow Technical Architect
Linkedin:

Error Messages were already before abort statement and there are no conditions to the BR and it calls API when record is aborted otherwise record will be saved. I want to hide the save button only when record is aborted like after one click.