- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-03-2020 09:41 AM
I need the have the Cost Center Code show up in the list view of the Department table. I have created a custom field on the department table to keep this data. I need help with a BR to keep the two in sync if it changes on the Cost Center table. Two departments could use the same code.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-03-2020 10:49 AM
Ok, then configure below script in business rule on cost center table to update cost center custom field on department table
Make sure to update correct custom center cost center field name in this script.
var dep = new GlideRecord('cmn_department');
dep.addQuery('u_cost_center',current.sys_id);
dep.query();
while(dep.next()){
dep.u_cost_center = current.sys_id;
dep.update();
}
Regards,
Sachin

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-03-2020 09:44 AM
You don't need to write BR for this requirement.
You can configure flow on cost center table using flow designer to sync data and update record in department table.
https://docs.servicenow.com/bundle/orlando-servicenow-platform/page/administer/flow-designer/reference/update-record-flow-designer.html
Regards,
sachin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-03-2020 10:03 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-03-2020 10:17 AM
You need to use for each flow logic in your flow to find out all departments with same cost center code and then update department records.
Regards,
Sachin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-03-2020 10:38 AM
I appreciate the direction but I am not real familiar with Flow Designer