logo

NJP

Make Attachments Mandatory in Incident using Business Rules

Import · Jan 16, 2023 · article

// Add your code herevar incAtt = new GlideRecord('sys_attachment');incAtt.addQuery('table_sys_id', current.sys_id);incAtt.query();if (!incAtt.hasNext()) {gs.addErrorMessage('Please add attachment while creating an incident!!!');current.setAbortAction(true);}

})(current, previous);

If my video/content helped you in any way, please mark this video/content as BOOKMARK, SUBSCRIBE & HELPFUL

Best Regards,

Prashant Kumar (LearnIT)

YouTube Channel LearnIT: https://www.youtube.com/@learnitwithprashant

Blog LearnIT: https://medium.com/@LearnITbyPrashant

Prashant Kumar LinkedIn: https://www.linkedin.com/in/learnitbyprashant/

ServiceNow Community Prashant Kumar - https://www.servicenow.com/community/user/viewprofilepage/user-id/19635

View original source

https://www.servicenow.com/community/developer-blog/make-attachments-mandatory-in-incident-using-business-rules/ba-p/2443921