- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2022 06:44 PM
On load , I am able to get the sys_id that was passed through the URL and I've set this value to a field called project.
I would like to query the u_earb table to find the record that matches that sys_id . Then populate variables on the catalog based on that record .
I have a rough script , but it doesn't appear to be working .
function onLoad() {
var project= g_form.getValue('project');
var gr = new GlideRecord('u_earb');
gr.addQuery('sys_id',project);
gr.query();
g_form.setValue('u_earb_request_type',gr.u_earb_request_type);
}
Solved! Go to Solution.
- Labels:
-
Service Portal Development
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2022 09:12 PM
update line 5 in client script as this
gaPhone.addParam('sysparm_project', project);
In script include update line 7 as this
this.getParameter("sysparm_project");
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
02-23-2022 08:08 PM
Hi,
did you try to get data from some other field?
If that doesn't work then you can use GlideAjax
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
02-23-2022 08:22 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2022 08:26 PM
Hi,
you forgot to add this line in Ajax
add this after line 4 to call the function
gaPhone.addParam('sysparm_name', 'get_phone');
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
02-23-2022 09:12 PM
update line 5 in client script as this
gaPhone.addParam('sysparm_project', project);
In script include update line 7 as this
this.getParameter("sysparm_project");
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
02-23-2022 09:03 PM
Hi Mike,
in script include line no:7. replace project with sysparm_user
this.getParameter("sysparm_user");