How to get sys_id for record after g_form.submit()?

hamzaathar
Tera Expert

The sc_cat_item page on service portals allow users to submit a catalog item.

I am going through the code on the widget and it seems like the submit button calls g_form.submit() to produce the record.

 

How can I get the sys_id of the record if g_form.submit() is successful? I need to retrieve it in the same widget, preferably in the same function that calls g_form.submit().

6 REPLIES 6

palanikumar
Mega Sage

Hi,

Are you using a normal Client Script or Client Controller script from widget? g_form is not accessible from Widget unless you created any local variable.

In normal client script, the form will be submitted after this command, so even if you capture, the page would go to next page 

Thank you,
Palani

Look into the code of the widget on the sc_cat_item page. It uses g_form.