- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-24-2020 10:21 AM
I am trying to import data in Hardware [alm_hardware] table. There is one field on the form called 'stockroom' (referenced from alm_stockroom). I am not able to update this field. Any suggestions as in why it is happening would be great. I am importing data from excel and in import set the data is coming correctly in the source field.
As this is a reference field, tried to get the sys_id from the referenced table by using onBefore script but still it is not updating.
One strange behaviour observed though that when i try to upload same data again this field value is getting updated. But i want it to update at the first attempt.
Solved! Go to Solution.
- Labels:
-
Enterprise Asset Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-25-2020 12:42 AM
I am able to update the stockroom field. Making asset state to In use and then updating the stockroom value from onBefore script helped.
Also , updated choice action to 'ignore' and referenced field value to 'name'

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-24-2020 10:38 AM
Hi,
Since its a reference field you are importing with the name of the Stockroom can you try leaving the field
Referenced value field name empty once & then run the load.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-24-2020 10:49 AM
Hi,
Can you please try using name in Reference value field name instead of stockroom?
Please mark this Correct & Helpful if it answered your question.
Muhammad

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-24-2020 11:14 AM
Hi,
Use OnBefore Transform map script to do your task-
(function runTransformScript(source, map, log, target /*undefined onStart*/ ) {
target.stockroom = source.stockroomName; //replace back end name stockroom for target table and souce table(staging table)
})(source, map, log, target);
Please Mark correct/helpful answer if it help you in any way
Thanks,
Kunal

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-24-2020 11:46 AM
Hi,
In your transform map choice action, you have kept the type as 'create'. For a drop down or a reference fields, keeping 'choice action' as 'create' forces the data to be inserted forcefully into the reference table.
Thus, in the first operation, a stockroom record gets created with the string name from the source. You may check whether the stockroom table has a new record with the name from the source/ staging table.
In second case, the record from source/staging table finds a match in the stockroom table(created in previous step) and thus successfully creates the alm_hardware table with the correct stockroom field value.
Correct practice should be to load the dependent data first and then the actual data.
Regards,
Anirban