How to restrict user to upload only 1 attachment at a time from Portal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2023 12:33 AM
Hi Team...
How to restrict users to upload only one attachment at once via the add attachment(paper clip) icon in ServiceNow portal for widgets(using clone of the widget "ticket attachment").
could anyone please suggest...
Thanks in advance.
Regards,
Kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2023 01:20 AM
Hi @skumar_srbh ,
Please refer below thread.
https://www.servicenow.com/community/now-platform-forum/upload-single-attachments/m-p/1086203
Please mark as correct answer if this solves your issue.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2023 05:50 AM
@Sonu Parab - Thanks for suggestion but that thread is not complete... although I have similar issue wrt. the "custom widgets" & single file upload..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2023 01:27 AM
Please find below :
https://docs.servicenow.com/bundle/sandiego-servicenow-platform/page/administer/notification/referen...
Also check in Browse to the following location on the instance: System Properties -> Security.
If it's helpful them mark as correct .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2023 07:27 AM
@skumar_srbh Tried and tested 100% working solution.
Add the below code in setAttachments function as shown in the image below.
if(attachments.length == 1){
document.querySelector(".sp-attachment-add").disabled = true;
}else{
document.querySelector(".sp-attachment-add").disabled = false;
}
Please mark as correct answer if this solves your issue.
ServiceNow Community Rising Star, Class of 2023