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

No the client is using the portal and that is why I have a problem.

I cannot get the sys_id that matches the sys_id in the attachment table to use the old code I have.

I either need to find a way to get that sys_id or write some new code for the portal that can do the content type check

I have not seen anything that can currently give me that information

Hi,

Can you explain what is your business requirement?

It is not required to use GlideRecord to get the file names user added on the catalog item during submission

If you mention the requirement another approach can be shared

Regards
Ankur

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

On the portal, an attachment is added to an item and the CONTENTS must be of a specific type - so say Excel and the user must not be able to submit if it is not.

File name checking is not enough for the client

Hi,

I guess we can control these with the attachment variables. Please check the below link for more information.

Types of service catalog variables | ServiceNow Docs

@poyntzj 

then in that case you would require onSubmit client script only

that sys_id is for the cart item

Regards
Ankur

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