if incident record if their any attachment no need to show any alert .If attachment is not their show the alert
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-27-2017 10:03 AM
hi ,

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-29-2017 02:42 AM
Hi Shloke: I agree.
Hi Venkat,
Shloke's response would be ideal to achieve your requirements. Please let us know you get any issue.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-29-2017 02:24 AM
you can do this by onsubmit client script. On submit check the attachement ad return true or false accordingly. Will post the check attachmnet code shortly.
Thanks
Note: please hit helpful/correct based on impact
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-29-2017 02:28 AM
var inc = gel('sysparm_item_guid').value;
var gr = new GlideRecord("sys_attachment");
gr.addQuery("table_name", "incident");
gr.addQuery("table_sys_id", inc);
gr.query();
if (!gr.next()) {
alert("You must attach a file to submit.");
return false;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-29-2017 02:25 AM
Hi you may achieve this by querying the sys_attachment table using client script. Try the below code:
var sysid = g_form.getUniqueValue();
var attach = new GlideRecord('sys_attachment');
attach.addQuery('table_sys_id',sysid); //sysid= replace with your current record's sysid
attach.query();
if(attach.next()){
alert("form contains attachment");
}
more info here:
Re: How do I check file attachment in a form by clientscript
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-06-2017 01:06 PM
Hi,
Did you got a chance to Test the Solution provided for your query.
If your query is Resolved, Please mark the answer as correct so that the thread can be removed from the Unanswered list.
Regards,
Shloke
Regards,
Shloke