g_form.getValue("sysparm_item_guid") not working

Community Alums
Not applicable

Hi 

i was getting no value when using g_form.getValue("sysparm_item_guid") i have verified it using alert it is displaying empty. I have used UniqueValue() but the sys_id are different and also i have used gel it is also not working can anyone help me how to guid value.

8 REPLIES 8

Alka_Chaudhary
Mega Sage
Mega Sage

Hello @Community Alums ,

Please give more information or script screenshot.

Community Alums
Not applicable

@Alka_Chaudhary  The cataog client script i have used is below:

 

 

function onSubmit() {
var cat_id = g_form.getValue("sysparm_item_guid");
alert(cat_id);
var gr = new GlideRecord("sys_attachment");
gr.addQuery("table_name", "catalog_category_request");
gr.addQuery("table_sys_id",cat_id);
gr.query();
if (!gr.next()) {
alert("You must add an attachment before submitting this request.");
return false;
}
}

 

When i start submitting the record producer it is displaying same statement and not getting submitted.so when i use cat_id as alert then it is displaying the value as empty as per my analysis

Use 'g_form.getUniqueValue()' instead of 'g_form.getValue("sysparm_item_guid");'. will fix the script.

Community Alums
Not applicable

@Alka_Chaudhary  I have tried using g_form.getUniqueValue() but i was getting same issue the alert "You must add an attachment before submitting this request." is coming repeatedly and not submitting even i have attached the attachment