The CreatorCon Call for Content is officially open! Get started here.

is there and equivalent of "g_form.getElement('sysparm_item_guid').value" in the portal ?

poyntzj
Kilo Sage

Looking to revise one of my old Client Scripts which depends on checking a record while the user is in a catalog item

In the old CMS I would use  g_form.getElement('sysparm_item_guid').value which obviously fails in the Portal, but wondered if there is an equivalent I can use

I can see the Catalog Item is already assigned a new sys_id in the instance, but I cannot find how to access this Id from the portal.

 

Any ideas ?

 

TIA

24 REPLIES 24

Hi,

I could not find the da8c70e62fe930903c345fd62799b6cc in the HTML

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

this link has some workaround using widgets

it is worth trying

Is there a way to get the cart item id in portal

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

That works - though need to modify an ACL to change that. 

I remember some code from another site that once added sp_form to a portal and was done via creating widgets.  I may visit that and see if I can merge the two in some way so that a widget can be used and added to the portal instead of editing the OOB one and the issues that may cause

@poyntzj 

Do share the approach once done so that it helps future members.

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Not sure I can do much more than that link and add the option in that widget

The code inside does the generateGUID, but it is not broadcast so I cannot get it elsewhere