What is gel('sysparm_item_guid').value

saahilkumar
Tera Contributor

Hi All,

Could you assist.

When is gel('sysparm_item_guid').value used, what does it denote

Thanks in advance

4 REPLIES 4

Bilal Ahmad2
Giga Contributor

hello harsh


can you please tell where we can find the parameter sysparm_item_guid'   which is passed under gel()


Hi Bilal,



While working on order guide and you want something to achieve on order guide you can use "sysparm_item_guid".



Can you please elaborate ur question? what parameter are you talking about?



Thanks,


Harshvardhan


Nestor Padilla
Kilo Contributor

Hi

 

I have an issue with that script... 

 

I try to validate there is an attachment, this is a regular Request (with NO order guide).

Here is the script:

 

function onSubmit() {
// Esto para exigir el adjunto de la foto en el formulario.
var cat_id = gel('sysparm_item_guid').value; //gel is shortcut for document.getElementById
var gr = new GlideRecord("sys_attachment");
gr.addQuery("table_name", "sc_cart_item");
gr.addQuery("table_sys_id", cat_id);
gr.query();
if (!gr.next()) {
alert("Debe adjuntar foto según especificaciones indicadas.");
return false;
}
}

 

WORKS in the ITIL role interface.. 

find_real_file.png

 

But in the Service Portal, I get an error

 

find_real_file.png

 

VM8661 js_includes_sp.jsx:66080 (g_env) [SCRIPT:EXEC] Error while running Client Script "EXPSP - Validate attachment": ReferenceError: gel is not defined
 
 
Not sure why this happens. Another form with the same script works fine.

 

Hi did you get the solution how to do it in service portal