Auto populate reference variable based on another reference variable on a catalog item form. I have reference variable Application referring to 'Name' field on Applications (cmdb_ci_appl) table and another list field called 'Roles' in it. On catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-28-2020 05:12 AM
Auto populate reference variable based on another reference variable on a catalog item form. I have reference variable Application referring to 'Name' field on Applications (cmdb_ci_appl) table and there is a list field called 'Roles' on same table, which has multiple roles associated to each application (these roles are maintained in a separate custom table). On catalog Item I want to populate roles from this list field values in a variable based on the application selected on catalog form.
Hope someone helps me get this! Thank you
- Labels:
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-28-2020 05:32 AM
Hi,
Seems duplicate question
I already replied to something like this earlier
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
‎09-29-2020 10:44 PM
Hi Ankur,
Thanks for your response!
Previous solution did not work for me. I tried something which is working on ITIL view(when I click Try it on catalog form it works) but not working on portal.
1 Reference Field - Application (cmdb_ci_appl)
2 List Collector Field - Security roles (custom table)
On Change Client Script when application changes
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue === '') {
return;
}
var gr= new GlideRecord('cmdb_ci_appl');
gr.addQuery('sys_id', newValue);
gr.query();
if(gr.next())
{
g_form.setValue('security_roles',gr.u_security_roles);
}
}
Its not working in portal view, Is it something with Orlando or please let me know if you could point in correct direction here.
Thanks in advance!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-29-2020 10:51 PM
Hi,
If your previous question answered then please close it by marking appropriate response as correct.
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
‎09-29-2020 10:52 PM
Hi,
GlideRecord is not supported in client script in portal; hence it is not working
please use GlideAjax and script include
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader