- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2025 11:42 PM
Hi Team,
I want to make attachment mandator on portal while approving for Specific catalog item.
Thanks,
BR
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2025 11:46 PM
why would approver add file during approval?
you can use before update business rule on sysapproval_approver table and query that target record to know if file is attached or not
OR
You can clone the OOTB widget on portal, make necessary changes and then add this newly cloned widget again to portal page
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2025 11:46 PM
why would approver add file during approval?
you can use before update business rule on sysapproval_approver table and query that target record to know if file is attached or not
OR
You can clone the OOTB widget on portal, make necessary changes and then add this newly cloned widget again to portal page
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-10-2025 12:22 AM
Hi @Prathamesh Cha1
you need to do the changes on the Approve widget inside the Approval form page, after cloned the OOTB.
if you need to put validation from the Approve Button from instance default view, modify the UI action
// Assume this runs in a UI Action on a record that must have an attachment
var gr = current; // current record (e.g., change_request)
var attachmentGR = new GlideRecord('sys_attachment');
attachmentGR.addQuery('table_sys_id', gr.sys_id);
attachmentGR.addQuery('table_name', 'sysapproval_approver');
attachmentGR.query();
if (!attachmentGR.hasNext()) {
gs.addErrorMessage('Approval is not allowed without at least one attachment.');
action.setRedirectURL(current); // redirect back to record
answer = false; // stop the UI Action
} else {
current.state = 'approved'
current.update();
}
Please Mark this Helpful and Accepted Solution. If this Helps you to understand. This will help both the community and me..
- Keep Learning
Thanks & Regards
Deepak Sharma