User should not able to delete attachment in change ticket after assess state

Shriyansh
Tera Contributor

Hi All,

 

I have a requirement to restrict user from deleting attachment in change ticket once state changes to assess. But user can add attachments in any state.

I have applied after/delete BR, but it is not showing any error. It is allowing user to delete the attachment and as the page gets refreshed, the document comes back. But this will make user confuse.

 

 

So I am looking for a approach that as user tries to remove the attachment after assess state, system should throw a error.

 

Thanks

1 ACCEPTED SOLUTION

@Shriyansh 

Nope. I don't think any other way.

1 thing you can do

1) hide the attachments itself in that state so that they don't see or delete it

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

View solution in original post

3 REPLIES 3

Ankur Bawiskar
Tera Patron
Tera Patron

@Shriyansh 

the BR on sys_attachment should be before Delete and yes it won't show the message which you give in addErrorMessage() function. That's platform behavior.

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

Hi @Ankur Bawiskar ,

 

Thanks for your quick response, but is there any other way to achieve this. As customer wants this.

@Shriyansh 

Nope. I don't think any other way.

1 thing you can do

1) hide the attachments itself in that state so that they don't see or delete it

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