How to get the display value of a reference variable in Script Include?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-11-2022 06:03 AM
Hi All,
ga.addParam("sysparm_groupid", g_form.getValue("app_name")); is the reference variable in client side which passes the sys_id to script include of the record.
var nam = this.getParameter('sysparm_groupid'); -> I am getting the sys_id of the record in Script Include
I want to get the display value of this record to query that in a table.
I have used getDisplayValue but it is not working.
var t = nam.getDisplayValue();
Please help!
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-11-2022 06:04 AM
Hi,
In this case, you either have to pass the display value, or you have to query the table this record belongs to and then get its display field.
-Anurag
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-11-2022 06:10 AM
Hi Anurag,
I have to query this record in a different table so I need the display value to query it.
How to pass the display value of that record from client script to script include?
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-11-2022 06:19 AM
Hi,
you can get the display value of a reference field or variable by the below script on client side
g_form.getDisplayBox('<field or variable name>').value
-Anurag
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-11-2022 06:15 AM
Hi
You can use
g_form.getDisplayValue('variable_Name');
to get the display value of the reference field but its not recommended.
Either I would suggest glide the table and get the display value of the record.
Thanks,
Murthy
Murthy