- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2020 09:38 AM
Hi all,
I tried auto populating the 'cost center' field value from users table, using the getReference method in business rule for incident form, but it didn't worked at all.
Please help me in retrieving the value of the cost center field value in the incident form
Solved! Go to Solution.
- Labels:
-
Incident Management

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2020 10:28 AM
Hi Naresh,
As suggested by Ankur above won't work in business rule as g_form.getReference() are client specific side options to be used.
Try using below business rule that runs After Insert on required table & make sure you have correct field name passed.
(function executeRule(current, previous /*null when async*/ ) {
// Add your code here
current.location = current.caller_id.location;
current.cost_center = current.caller_id.cost_center;
current.state = current.caller_id.state;
current.city = current.caller_id.city;
current.country = current.caller_id.country;
current.update();
})(current, previous);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2020 09:42 AM
Hello Naresh,
Please refer below link,
Please mark my answer correct and helpful based on your impact.
Thanks
Tanushree

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2020 09:53 AM
Hi Naresh,
Can you share your business rule script once for a check.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2020 10:01 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2020 10:07 AM
Hi Naresh,
in business rule g_form won't work
please use dot walking from caller_id and use before insert/update BR on incident table
I assume location, cost_center on incident are reference type
current.setValue('location', current.caller_id.location);
current.setValue('cost_center', current.caller_id.cost_center);
current.setValue('state', current.caller_id.state);
current.setValue('city', current.caller_id.city);
current.setValue('country', current.caller_id.country);
Mark ✅ Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader