Passing the value of a field in a Table to Service Portal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2023 09:50 AM
Hi guys,
I need a simple thing (it´s seems i guess) but right now is not working.
Basically i have a form that is part of a catalog item that contains different variables (see the image below).
In this form we have Agreed rate and i just want that this field to be fulfill like i have in the workspace (see the image below)
The client script that i did is like this: (the table that cointains the information is x_cioa2_hcx_t_engagement_hcx)
----------------------------------------------------------------------------------

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-01-2023 04:10 AM
@Diogo Lemos Are you running this client script on Service Portal, if it is the case then please note that GlideRecord queries are not supported in Client script on the Service portal. You need to replace your query with a GlideAjax call here. Please know more about GlideAjax here https://snprotips.com/blog/2016/2/6/gliderecord-client-side-vs-server-side#from-client.
Also, you can try to run the query in a background script
var hcxTable = new GlideRecord('x_cioa2_hcx_t_engagement_hcx');
hcxTable.addQuery('suggested_rate', '10');//add rate here
hcxTable.query();
if(hcxTable.next()){
gs.info('Record found');
}
and check if it prints any logs in system logs.