Need to update Location and Account details if Site ID inserts a value thru data load
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-22-2022 02:37 PM
I am loading data into Hardware Asset, if Site ID inserts value then respective Location Name and Account details should be updated. The Location Name and Account details are present in cmn_location table.
For Ex: In cmn_location, Location Name: New Jersey and Account: Contract(its a reference field) for the Site ID: 50353 then if we load the data in Hardware Asset, and if the Site ID: 50353 is the Location in Harware Asset should be 'New Jersey' and Account in Hardware should be 'Contract'

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-22-2022 02:54 PM
If you have a transform map, make Side ID as coalesce and it should work.
Please mark this response as correct or helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-22-2022 03:06 PM
We have a Serial Number is the 'Coalesce' and also I need to update Location and Account details if Site ID changes, need to do with the Business Rules. Kindly help.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-22-2022 03:25 PM
You need to create an onBefore Insert/update Business rule with condition Site ID changes
And in the script
var lc = new GlideRecord('cmn_location');
lc.addQuery('<site id field in location table>',current.<siteid field name>);
lc.query();
if (lc.next())
{
current.<account details field name> = lc.<account details field name in location>;
current.<location field name> = lc.<location field name in location>;
}
Please mark this response as correct or helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-22-2022 03:42 PM
I have written the script but Location field is setting to empty after saving the form.
Also I noticed the Location field is auto populating thru onChange client script.
But both Location(should not set it to empty after saving the form) and Account details should be updated.