Notifications

117 views

Description

Symptoms


Usage of sysparm_item_guid in the client scripts for getting the sys_id of the current catalog item works perfectly fine in Platform UI. However, the same script fails to retrieve sys_id in service portal.

Cause


The reason the same client script doesn't fetch the sys_id of the current item in service portal is because there will not be any element by name sysparm_item_guid in Service Portal DOM/UI.

Resolution



The client script looks for a parameter "sysparm_item_guid".
This parameter will not be available in Service Portal. You need to use the 'sys_id' of the catalog item instead.

If the requirement to get the catalog item sys_id in service portal, you can use of the following API instead of sysparm_item_guid:
========================
g_form.getUniqueValue();
========================

To know more about the usage of this GlideForm API, please refer to the below product documentation.

https://developer.servicenow.com/app.do#!/api_doc?v=kingston&id=r_GlideFormGetUniqueValue

 

Article Information

Last Updated:2019-08-02 20:54:52
Published:2019-01-19