web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Technical: How to copy a table from one legal entity to other legal entity.

(0) ShareShare
ReportReport
Posted on by 120

Hi All,

Need your inputs in designing and building this functionality.

I want to copy data from a table for e.g RetailDiscountCode in one legal entity to another legal entity. Data for a particular record will be selected in source legal entity , in the target legal entity, need to check if similar data exists in the table. Based on check, action will result in either create,update or delete.

Can this be done in generic way , so that any table can be passed as parameter and data for that table can be copied?

I have looked at DictTable, DictField, but not sure, how to identify unique record on a table and match in a generic function.

Please suggest.

Thanks.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Mea_ Profile Picture
    60,286 on at

    You can use dictindex to get fields from primary index community.dynamics.com/.../reflection-code-to-iterate-on-the-primary-index-of-the-table then select record base on these fields.

  • MSKAX Profile Picture
    120 on at

    Hi Ievgen,

    Thanks for your inputs and the link.

    A follow up question here, this would help decide on the possibility to code this generic function.

    Using dictTable.primaryIndex() as in job from above link identifies and returns RecId as primary key on e.g table RetailDiscountCode.

    However, when I switch company and trying to find record in the table, the RecId is not available. I should use OfferId to match and take action on unique record.

    Does this mean, a generic method is not possible? Identifying unique record should be handled case by case based on the table? pls confirm.

    Thanks.

  • Verified answer
    Mea_ Profile Picture
    60,286 on at

    Ultimately generic method for your task is not possible because some tables do not have unique index except RecId because allow all fields to be repeated and you have to define what means unique in this case somehow.

    For other table you can use any unique index for you search if primary is recid. You can find it using dictIndex as well.

  • MSKAX Profile Picture
    120 on at

    Thanks Ievgen.

    As ever, your inputs have been very valuable, helped to decide and move on.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Joris dG Profile Picture

Joris dG 5

#2
Sagar Suman Profile Picture

Sagar Suman 2 Super User 2026 Season 1

#2
Alexey Lekanov Profile Picture

Alexey Lekanov 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans