- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2022 02:47 AM
To make attachment mandatory on Native View of catalog item.
Got a related post for the same , It suggest for DOM manipulation . Can somebody please tell if using DOM manipulation will not impact anything later ?
https://community.servicenow.com/community?id=community_blog&sys_id=00edd9751bb090d0ada243f6fe4bcba8&feedbackAction=comment
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2022 02:59 AM
Hi,
this script in onSubmit would work fine for Native
function onSubmit(){
var count = getCurrentAttachmentNumber();
if(count == 0){
alert('Please add at least 1 file');
return false;
}
}
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2022 04:51 AM
I don't think it would impact. It's just that DOM is not good practice.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2022 03:38 AM
to make it work in Both Native + Portal check this link
Possible Ways for Making an Attachment Mandatory : Service Portal/Native UI
Making Attachments Mandatory in SP: The Ultimate Guide (Including Paris)
SERVICE PORTAL: Make Attachments Mandatory on Service Portal
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2022 03:05 AM
Hi Mishu,
In Catalog Item table you can use Mandatory attachment checkbox field, set that to true for your item which you trying to set mandatory attachment.