- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-26-2024 11:07 AM
I have Supporting Docs (Attachment Type) field on Table IT Tracker. I want to make the Attachment type field read only when the state of the request is closed. I tried UI policies and client scripts, but it did not work. I understand that ACL's are the only way to do it, can you guide me through the steps ?
Thank you!!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-26-2024 12:16 PM - edited ‎03-29-2024 12:26 AM
Hi @Madhan007 ,
Yes you have to create acl for that field,
If you want to allow user to download but stop from uploading or deleting attachment then create operation write acl,
If you want to restrict user the visibility of that field then you can write read acl
check advanced in acl and write your script,
Here i have written write on file attachment field so when state is closed complete it doesn't allow me to write anything (such as update or delete)
modify the below script according to your need,
if (current.state == '3') //chceking the state is closed complete
{
//gs.info("acl " + current.state);
answer = false; //return false acl
} else {
// gs.info('else');
answer = true;
}
Please mark this comment as Correct Answer/Helpful if it helped you.
Regards,
Swathi Sarang
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-26-2024 11:14 AM
Hi @Madhan007 ,
Can you share the screen shot of that page and UI Policy/Client Script, you have written so far.
-Thanks,
AshishKM
Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-26-2024 12:16 PM - edited ‎03-29-2024 12:26 AM
Hi @Madhan007 ,
Yes you have to create acl for that field,
If you want to allow user to download but stop from uploading or deleting attachment then create operation write acl,
If you want to restrict user the visibility of that field then you can write read acl
check advanced in acl and write your script,
Here i have written write on file attachment field so when state is closed complete it doesn't allow me to write anything (such as update or delete)
modify the below script according to your need,
if (current.state == '3') //chceking the state is closed complete
{
//gs.info("acl " + current.state);
answer = false; //return false acl
} else {
// gs.info('else');
answer = true;
}
Please mark this comment as Correct Answer/Helpful if it helped you.
Regards,
Swathi Sarang
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-27-2024 12:04 AM
Hi @swathisarang98 , I want to allow users to read but not write/update the attachments. so I am creating a write ACL on the field. but can I give the condition as state is closed in Conditions field instead in script?
Thank you!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-27-2024 10:59 AM
@Madhan007 I tried that but for some reason if i give direct condition it didn't work for me so i went ahead with scripting. Let me know if you are facing any issues
Please mark this comment as Correct Answer/Helpful if it helped you.
Regards,
Swathi Sarang