- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-09-2024 05:42 AM - edited 07-10-2024 11:12 AM
My requirement is to update the (Environment field value) dropdown field, based on the value in the Key Values related list on the same form. I am trying with Business rule After update, but it is not working out.
I have written after insert and update BR on related list table (child table) but it is not working.
condition : key is environment and value is development.
Can any one have any better idea ?
Thanks,
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2024 10:30 AM
HI @Munna1
Yes Please check the table name as Abhnezer Mentioned
Add Conditions in the BR to trigger only when key value is specific or you can add that check in the code too.
var gar = new GlideRecord('cmdb_ci_cloud_db_cluster'); // parent table
gar.addQuery('sys_id', current.configuration_item);
gar.query();
if (gar.next()) {
if (current.value == 'y')
gar.environment = 'Development'; //use development choice backend value here.
else if (current.value == 'z')
gar.environment = 'acceptance'; //use acceptance choice backend value here.
gar.update();
}
Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2024 11:24 AM
is the BR working correctly now ? if its I would appreciate it if you mark the answer helpful