How to import data with related list records
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-10-2022 12:14 AM
Hello Community,
we are trying to import the data from one personal dev instance to other, But we are facing some issue here.
We have lot of records in instance A having records with related list records .Can anyone have any idea how to import with related list records as well?
Thanks,
Steve An
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-10-2022 12:27 AM
Hello,
You can add Transform Scripts to your Table Transform Map. Add an 'onAfter' script to your map. This functions just like an onAfter business rule. But you won't have a 'current' context. Instead you have a 'target' context. Each time you insert a row into the target via the transform, the onAfter script will run.
The script can insert records into your related table. Simply set the reference field on the related record to the sys_id of the record that's been inserted by the transform map (target.sys_id).
Please mark my answer as correct/helpful based on Impact.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-10-2022 12:36 AM
Thanks for the quick reponse Sourav can you provide us sample script it would be great help and we can try with this approach ?
Thanks,
Steve An
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-10-2022 01:01 AM
Hello,
Giving a second thought maybe script is not a good way to do it as you may have a lot of record which you will have to hard core. If you have only two tables then do the following:-
Taking Incident table as an example:-
Export the data from incident table
And then import it on the Incident table of your other instance as below:-
Now if the related list is Incident task you do the the incident task table do the same. Due to the reference field it will automatically come under the related list in the new instance.
Please mark my answer as correct/helpful based on Impact.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-10-2022 12:41 AM
Hi,
Can you try export as xml file and import in your target instance? If it one time activity, export and import is enough. anyway you are going to do the Clone activity it will manage the instance sync.
If you need dynamic way, you should write the script to move the data.
Regards,
Suresh.
Suresh.