Prevent user from deleting the attachment
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-04-2018 03:39 AM
I have a requirement to restrict user from deleting the attachment in requested item table.
If any one has implemented this requirement please share your thoughts.
Thanks in advance

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-04-2018 04:29 AM
You can simply write the condition in the script field.
if(current.field_name.indexOf('ABC') != -1)
answer = false;
else
answer = true;
Note: current will point to sys_attachment table. Have a look at the table to construct the right condition.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-04-2018 05:39 AM
I will give it a try and update you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-04-2018 09:27 PM
It is not working. Please help

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-04-2018 10:09 PM
It will work. Check for all the existing ACLs. By default there will be two 'Delete' ACLs on sys_attachment table. If you create new one there will be 3 ACLs. Be informed that if any one of them grant access to the user, user will get the access.
Try this,
Inactivate the default two ACLs and then your ACL will take effect.
Note : Please modify the two ACLs as per your requirement as it'll have global effect. And I encourage you to go through the code of these ACLs once for better understanding.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-27-2019 03:35 PM
How come you made the answer false inside the script?