Validate attachments on a record producer

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2014 12:56 PM
I need to validate if the user has attached at least one document in a record producer and I'm trying to use the following function in the onSubmit Client Script but id doesn't work. I'm using the same function in the form itself and it works there.
The call to getUniqueValue() does not return anything. Does anybody knows what applies in this case?
function validateAttachments() { var sid = g_form.getUniqueValue(); var gr = new GlideRecord('sys_attachment'); alert(sid); return gr.get('table_sys_id', sid); }
Regards,
/Amado Sierra
- Labels:
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2014 12:58 PM
Hi,
Please check below link:
Mandatory Attachments Order Guide and Catalog Items sharing solution
Please mark answer as correct/helpful
Regards,
Solutioner

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2014 01:19 PM
Hi solutioner now,
I have tried using the following functions but none of them return a value:
var ord_id = gel('sysparm_cart_edit').value;
var cat_id = gel('sysparm_item_guid').value;
Not sure if gel is still supported, my instance is running Calgary.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2014 01:02 PM
I think the simplest solution can be found here - Is it possible to require a user to add an attachment before submitting a catalog item?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2014 01:25 PM
Hi Jim,
This does the trick but I'm still curious as to which method could return the id of the record producer. It seems like gel is no longer supported and there might be other Client Scripts I will need to validate.