How to restrict end user to delete attachment based on HR Case state?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2024 01:32 AM - edited 02-20-2024 01:33 AM
Hi Team,
We have a requirement where we need to restrict an end users to delete an attachment on portal when the state of HR case is either draft or custom action. (attachement deletion is allowed on these states only)
I tried with ACL.
Still not working!
Please help!
Thanks,
Sri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-26-2024 12:52 AM
Is this the only delete ACL you have on the attachment table now?
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-25-2024 08:22 PM
Hi @Sri56 ,
Name: Restrict Delete attachment on RITM
Table: sys_attachment
Advanced: check
When: Before
Delete: check
Filter Condition: Table Name is sn_hr_core_case(HR Table name) and state is new(change to your state)
Script Conditon:
(function executeRule(current, previous /*null when async*/) {
// Add your code here
if(!gs.hasRole('admin')){
current.setAbortAction(true);
}
})(current, previous);
If I could help you with your Query then, please hit the Thumb Icon and mark it as Correct !!
Thanks & Regards,
Sumanth Meda