MyRapidi
MyRapidi

Search our Wiki

MS Dynamics BC Customer -> D365 Sales Account Add/Update

This transfer will transfer new and updated MS Dynamics Business Central Customers into D365 Sales Accounts. All mappings are either 1:1 or additional lookups have been created. However, there are specific mappings where you have more than 1 option to map the indicated fields:

  1. Country_Region_Code -> address1_country
  2. Business Central Field D365 Sales Field
    ##BLANKVALUE(LSLOOKUP('COUNTRIES',"Country_Region_Code"),SKIPFIELD()) address1_country
    Country_Region_Code address1_country

    Note: In Business Central, the field Country_Region_Code is a predefined picklist that will provide you with all country codes and country names. In D365 Sales, the field address1_country is a free text field and there are no restrictions around it.

    • 1:1 mapping where Country_Region_Code = address1_country if both fields contain the same information;
    • Formula ##BLANKVALUE(LSLOOKUP('COUNTRIES',"Country_Region_Code"),SKIPFIELD()) that retrieves the country code from a pre-existing static lookup table called COUNTRIES and ,if the formula evaluates to NULL, this field will be skipped during the data transferring process.
  3. Currency_Code -> transactioncurrencyid
  4. Business Central Field D365 Sales Field
    ##BLANKVALUE(LSLOOKUP('TRANSACTIONCURRENCY',"Currency_Code"),SKIPFIELD()) transactioncurrencyid
    ##IF(EQUALS("Currency_Code",''),DBLOOKUP('DESTDS','transactioncurrency','isocurrencycode','%%CURR%','transactioncurrencyid'),DBLOOKUP('DESTDS','transactioncurrency','isocurrencycode',"Currency_Code",'transactioncurrencyid'))) transactioncurrencyid

    Note: In Business Central, the field Currency_Code is a predefined picklist that will provide you with all currency codes. In D365 Sales, the field transactioncurrencyid is a GUID field and can only be used in this manner. A 1:1 mapping is not possible due to the above.

    • Formula ##BLANKVALUE(LSLOOKUP('TRANSACTIONCURRENCY',"Currency_Code"),SKIPFIELD()) where the D365 Sales transactioncurrencyid is retrieved from a dynamic lookup table and ,if the formula evaluates to NULL, then the field is skipped from the data transferring process.
    • Formula ##IF(EQUALS("Currency_Code",''),DBLOOKUP('DESTDS','transactioncurrency','isocurrencycode','%%CURR%','transactioncurrencyid'),DBLOOKUP('DESTDS','transactioncurrency','isocurrencycode',"Currency_Code",'transactioncurrencyid'))) where we have 2 lookups made on the destination ( D365 Sales) to retrieve the transactioncurrencyid.
  5. Salesperson_Code ->Ownerid
  6. Business Central Field D365 Sales Field
    ##'/systemusers('+BLANKVALUE(LSLOOKUP('%%LSUSER%'+'#REVERSE',"Salesperson_Code"),'%%DEF_OWNER%')+')' ownerid
    ##CASE(DBLOOKUP('DESTDS','systemuser','new_salespersoncode',"Salesperson_Code",'systemuserid'),'',SKIPFIELD(),'/systemusers('+DBLOOKUP('DESTDS','systemuser','new_salespersoncode',"Salesperson_Code",'systemuserid')+')') ownerid

    Note: In Business Central, the field Salesperon_Code is a free-text field which is usually populated with the salesperson’s initials. In D365 Sales, there is no standard field that can hold this information in the same manner. Instead the owner ID is the equivalent of the Salesperson Code but it is stored as a GUID field.

    • Formula ##'/systemusers('+BLANKVALUE(LSLOOKUP('%%LSUSER%'+'#REVERSE',"Salesperson_Code"),'%%DEF_OWNER%')+')' that will retrieve the corresponding owner ID for the Business Central Salesperson Code. This data is fed into D365 Sales by a separate transfer and is available in the dynamic lookup table called LSUSER. If the formula evaluates to NULL, a default user will be assigned to the record that will be created in D365 Sales. The default owner ID is created as a TAG and the value will be the actual GUID.
    • ##CASE(DBLOOKUP('DESTDS','systemuser','new_salespersoncode',"Salesperson_Code",'systemuserid'),'',SKIPFIELD(),'/systemusers('+DBLOOKUP('DESTDS','systemuser','new_salespersoncode',"Salesperson_Code",'systemuserid')+')') which will perform a lookup on the destination (D365 Sales) but it will require setting up a new field new_salespersoncode to hold the salesperson code.