OnAfter or Field map script transform script help needed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-11-2017 08:12 AM
Hi All,
Can someone advise on how I should approach the below requirement:
I have load a list of companies into core_company table.
They all have a customer id, debit group id which is often the same but not always
After each load I would like to run an onAfter script to take the debit group id and find the matching name in the core_compnay table
and add this to the reference field Parent.
comp id Parent field should result in Debit group id
100000 | xyz company | street 19 | London | UK | xyz company | 100000 | ||
100001 | abc Ltd | way 1 | Berlin | DE | abc Ltd | 100001 | ||
100004 | time Ltd | lane 2 | Zürich | CH | xyz company | 100000 | ||
100005 | now Ltd | road 3 | New York | USA | time ltd | 100004 |
Any suggestions greatly appreciated.
Thanks,
Ellie
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-11-2017 01:26 PM
May be there is a typo
target.parent = gr.sys_id;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-12-2017 05:10 AM
Hi srnewbie, Venkat,
I got this resolved. When the company id and debit group value are same then you cannot add as you cannot be your own parent.
For records with different debitor group the parent was added.
Thank you very much for your effort to help me with this
Ellie