Unable to populate List Collector variable in Catalog Item using g_form.setValue() from GlideAjax
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago
Hi Team,
I am trying to auto-populate a List Collector variable on a Catalog Item and make it read-only based on a checkbox selection.
Scenario:
Order Guide: New Employee
Catalog Item: Business Application Access (BAA)
List Collector Variable: configuration_items
Table: cmdb_ci
Variable Type: List Collector
Note : if supplementary_maintenance_contractor_onboarding is true Business Application Access (BAA) check true and display the releted form on New Employee
varibale - configuration_items is on Business Application Access catalog item.
When the user selects the checkbox supplementary_maintenance_contractor_onboarding, I call a Script Include using GlideAjax and retrieve the sys_ids of two applications (ServiceNowDev and Microsoft Excel).(refer to screenshot for scripts)
GlideAjax returns the correct sys_ids.
The records exist and are valid cmdb_ci_appl records.
Tested with hardcoded sys_ids as well.
g_form.setValue() does not populate the List Collector.
g_form.getValue('configuration_items') returns blank after setValue().
The field " configuration_items" List Collector belongs to the Business Application Access catalog item which is part of the Order Guide.
My understanding is that the client script is executing in the Order Guide context and therefore cannot access variables belonging to the included catalog item.
Any guidance or examples would be greatly appreciated.
Thanks!