Attachments allowed on inactive cases in Portal View
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-26-2017 12:40 PM
I have received a request to disable the attachment button on the portal after our HR cases go inactive. We have already disabled the ability to comment on inactive cases by modifying the ACL to only allow write functions on active cases. This causes the text field to become unavailable once the case is closed, but the attachment button can be selected, an attachment can be added and it will update the closed case.
Anyone know how to go about hiding or deactivating this button in the HR Service Portal under certain conditions?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-26-2017 07:33 PM
You can do DOM manipulation by javascript or JQuery. https://www.servicenowguru.com/scripting/client-scripts-scripting/removing-form-buttons/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-27-2017 08:52 AM
This is actually a portal widget and not a catalog item, so I'm in some unfamiliar territory here. More specifically it is the "Ticket Conversations" Widget. Would the client script still apply here?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-24-2017 12:39 AM
Hello Keith,
The easiest way to achieve this is using proper ACL's. Setup proper ACL's so that users are not allowed to update anything on HR Cases if the active flag is false. Once, the ACL's are setup; the users will not be able to add attachment or update anything.
Or you can create copy of widget - Ticket Conversations to handle this. Below highlighted line of code called in HTML-
This checks the parameter from Server Side code line # 51 and 52 in Helsinki version:
Let me know if you any further queries.
Best Regards,
Jaikumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-10-2019 12:44 AM
Hi Jaikumar,
I am quite new to portal development. Could you please help me with the code on how precisely I can modify the canAttach() or canWrite() in the Server Side script to restrict the attachments for Closed/Cancelled cases.
Appreciate your response.
Thanks,
Devika Shukla