How to disable/hide the remove button in attachments in Agent Workspace

Lavanya R1
Tera Contributor

Hi everyone,

I have a requirement when the change is not in new state, the removal of the attachment should be restricted in Agent Workspace. But, the user should be able to add attachment in all the stages.

It would be helpful if anyone could answer.

Thanks in Advance

 

1 ACCEPTED SOLUTION

Subrahmanyam2
Giga Guru

Hi Lavanya,


Attachments are finally stored in sys_attachment (meta data), sys_attachment_doc (the actual data) tables.
You have to write before delete business rules on each of these to abort the deletion action, then the deletion will be stopped.
But with only this solution the problem is, users may see that attachment is removed when performing the removal action, but when they reload the form like (incident) it will show the attachment again.
Even if we keep the gs.addErrorMessage in business rules they will not show the error messages as these actions are done differently.

Please check the snapshots of Business rules below:
find_real_file.png

find_real_file.png

find_real_file.png

find_real_file.png

 

You may use still want to keep the UI page customizations as they will work in normal UI (If you remove UI page customizations in normal UI, then the error message while trying to remove attachments will not appear), but the maintenance overhead during upgrades will be there.

 

Thanks and regards,

Subrahmanyam Satti

View solution in original post

15 REPLIES 15

@Lavanya R 

But the BR would run for normal and agent workspace UI both.

How are you differentiating if only for agent workspace?

it would be nice if you share that so that it helps members in future.

Regards
Ankur

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

@Ankur Bawiskar Yes, I needed that change in both native - UI and Agent workspace.

Also, could you please look into my another question : 

https://community.servicenow.com/community?id=community_question&sys_id=18441459dbde8110aa66a9fb1396...

Thanks & Regards,

Lavanya

Can you respond to my earlier question on how did you achieve this?

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

Hello,

In the future, please state that clearly in your question that you were wanting that for both the platform UI and Agent Workspace. You specifically called out Agent Workspace and got lucky that someone didn't focus solely on that and gave you a solution that worked for both views.

Normally, if someone were to have read that and followed what you asked, we wouldn't be talking about ACLs and such (as that affects the platform as a whole).

Clearly stating your question helps us help you.

Take care!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

Subrahmanyam2
Giga Guru

Hi Lavanya,


Attachments are finally stored in sys_attachment (meta data), sys_attachment_doc (the actual data) tables.
You have to write before delete business rules on each of these to abort the deletion action, then the deletion will be stopped.
But with only this solution the problem is, users may see that attachment is removed when performing the removal action, but when they reload the form like (incident) it will show the attachment again.
Even if we keep the gs.addErrorMessage in business rules they will not show the error messages as these actions are done differently.

Please check the snapshots of Business rules below:
find_real_file.png

find_real_file.png

find_real_file.png

find_real_file.png

 

You may use still want to keep the UI page customizations as they will work in normal UI (If you remove UI page customizations in normal UI, then the error message while trying to remove attachments will not appear), but the maintenance overhead during upgrades will be there.

 

Thanks and regards,

Subrahmanyam Satti