How to make attachment mandatory in application from when user select the drop down
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2024 07:08 AM
Hi,
I have application table and drop-down values
field name is : Service manager- choices(dtit and non dtit)
when user select "non-dtit" then make attachment mandatory.
Regards,
Tharun
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2024 07:42 AM
Hi @Tharun13 ,
Can you please share more details about the application table, Is it something OOTB, please name it here.
If its some kind of form ( not the catalog item ) you can write UI Policy over that table and check for Service Manager Choice value and set the attachment field mandatory.
-Thanks,
AshishKM
Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2024 07:57 AM
Hello @Tharun13 ,
Write a before-insert/update business rule with the condition that the service manager is non-DTIT. Add the following script to check if an attachment is present.
(function executeRule(current, previous /*null when async*/ ) {
// Add your code here
var checkAtt = new GlideRecord('sys_attachment');
checkAtt.addQuery('table_sys_id', current.sys_id);
checkAtt.query();
if (!checkAtt.hasNext()) {
gs.addErrorMessage('Please add attachment while creating an record!!!');
current.setAbortAction(true);
}
})(current, previous);
Please mark my answer as correct and helpful if it resolves your query.
Thanks,
Alka
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2024 09:13 AM