g_form.getElement('sysparm_item_guid').value isn't work

Aya Hassan
Tera Contributor

i need to get the sys_id of the uploaded attachment from onsubmit catalog client but 

g_form.getElement('sysparm_item_guid').value isn't work it return an error "Cannot read properties of undefined (reading 'value')"
3 REPLIES 3

Robbie
Kilo Patron
Kilo Patron

Hi @Aya Hassan,

 

Quick clarification. Are you attempting this in the native view or Portal? Additionally, when you say from an 'onSubmit catalog client' - are you referring to that you need to check this before submitting the form?

 

Use the following syntax in a native view from the client script:

 

g_form.getValue('sysparm_item_guid');

 

To help others (or for me to help you more directly), please mark this response correct by clicking on Accept as Solution and/or Kudos.

 

Thanks, Robbie

 

i need it on portal , i have catalog item to upload attachment , after uploading i need the sys id for this attachment to do some logic

 

ChandanKuma
Tera Contributor

@Aya Hassan  were you able to get the sysid of attachment, I am also trying to get this, but don't find any solution.