D365 Finance & Operations and Dynamics AX Forum

Expand all | Collapse all

DMF/DIXF: How to include MCRCustTable in Customer entity

  • 1.  DMF/DIXF: How to include MCRCustTable in Customer entity

    TOP CONTRIBUTOR
    Posted Aug 20, 2019 09:56 AM
    #AX2012 #Technical #DataManagement

    I'm importing customers using DMF (a.k.a. DIXF), and I need to include MCRCustTable in the import process, but I have yet to get it working.

    MCRCustTable is related to CustTable by CustTable.RecId == MCRCustTable.CustTable.  I think this is what is making it challenging for me.

    I've tried creating a custom entity based on the MCRCustTable​​​​, with a "generate" method to lookup the custtable recid.  That resulted in only the last record inserted having a record in the MCRCustTable for some odd reason.

    I've tried adding the MCRCustTable to the DMFCustomerTargetEntity (with the default relation).  That results in the first record importing with a value of zero in the CustTable field and the rest hitting an error: "Cannot create a record in Customers (MCRCustTable). Reference: 0, lha.
    The record already exists."

    Does anyone have any suggestions on how to make this work?

    Thanks in advance.

    ------------------------------
    Daniel Zook
    Director of IT
    Lehman's
    Dalton OH
    ------------------------------
    Conference-AXUG_200x200


  • 2.  RE: DMF/DIXF: How to include MCRCustTable in Customer entity

    TOP CONTRIBUTOR
    Posted 25 days ago

    After setting this aside for a while, I ended up solving the problem by doing the following:

    • Created a separate custom entity (instead of adding MCRCustTable to the Customer entity)
    • In the Stage to Target mapping, made sure that the "generateCustTable" method is linked to the target table
    • Used the directions found on this page to code the addStagingLink so that the RecId of the relevant CustTable record is retrieved and added as a query range.

    This is now working.  (The Customer entity has to be imported first, obviously.)

    If anyone is trying to import into MCRCustTable and has questions about this was done, just let me know.



    ------------------------------
    Daniel Zook
    Director of IT
    Lehman's
    Dalton OH
    ------------------------------

    Conference-AXUG_200x200


If you've found this thread useful, dive deeper into User Group community content by role