is there and equivalent of "g_form.getElement('sysparm_item_guid').value" in the portal ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-26-2021 01:36 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-26-2021 04:22 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-26-2021 04:30 AM
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
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-26-2021 04:37 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-26-2021 04:42 AM
Hi,
I guess we can control these with the attachment variables. Please check the below link for more information.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-26-2021 04:44 AM
then in that case you would require onSubmit client script only
that sys_id is for the cart item
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader