- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
I have 2 reference variables as described below on a catalog Item:
business_application reference to cmdb_ci_business_app
service_offering references to service_offering
Requirement is if User selects "LES/MES - Mexico" in business_application then on service_offering it should get autopopulated as "LES/MES Application "
Similarly we have population of service_offering based on business_application as below :
| LES/MES - Senegal | LES/MES Application for PMMSN |
| LES/MES - Mexico | LES/MES Application for Mexico |
| LES/MES - Brazil | LES/MES Application for Brazil |
How can we achieve this in a a catalog item
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
Hi @,
You can achieve this requirement using an onChange Catalog Client Script on the business_application variable.
Whenever the user selects a Business Application, you can set the corresponding Service Offering using
g_form.setValue()
.
Example:
if (isLoading || !newValue) {
return;
}
var mapping = {
'SYS_ID_MEXICO': 'SYS_ID_SO_MEXICO',
'SYS_ID_SENEGAL': 'SYS_ID_SO_SENEGAL',
'SYS_ID_BRAZIL': 'SYS_ID_SO_BRAZIL'
};
if (mapping[newValue]) {
g_form.setValue('service_offering', mapping[newValue]);
} else {
g_form.clearValue('service_offering');
}
}
Make sure to use sys_ids instead of display values for accurate mapping.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
Hi @,
You can achieve this requirement using an onChange Catalog Client Script on the business_application variable.
Whenever the user selects a Business Application, you can set the corresponding Service Offering using
g_form.setValue()
.
Example:
if (isLoading || !newValue) {
return;
}
var mapping = {
'SYS_ID_MEXICO': 'SYS_ID_SO_MEXICO',
'SYS_ID_SENEGAL': 'SYS_ID_SO_SENEGAL',
'SYS_ID_BRAZIL': 'SYS_ID_SO_BRAZIL'
};
if (mapping[newValue]) {
g_form.setValue('service_offering', mapping[newValue]);
} else {
g_form.clearValue('service_offering');
}
}
Make sure to use sys_ids instead of display values for accurate mapping.
