Onsubmit Client Script to check Attachments on Record producer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-04-2018 05:33 AM
Hello,
I have a record producer on a custom table in custom application which has check box if checked need to attach the files , so i have been using below code it is working but even after attaching on the form i am getting same Alert and unable to submit the form , any help in this is much appreciated!
Onsubmit Client script code :
function onSubmit() {
attachOne = g_form.getValue('one');
attachTwo = g_form.getValue('two');
attachThree = g_form.getValue('three');
if(attachOne == 'true' || attachTwo == 'true' || attachThree == 'true') //checking if any of the attachment checkbox is ticked
{
var att = new GlideRecord("sys_attachment");
att.addQuery("table_name", "sc_cat_item_producer");
att.addQuery("sys_created_by", g_user.userName);
att.query();
if(!att.next())
{
alert("Please attach the Required Documnet to proceed with submitting.");
return false;
}
}
}
- Labels:
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-28-2018 12:47 AM
Even i'm facing the same issue, did you get any solution to fix this?