Importing Sales Orders into Dynamics 365 Business Central
This task will create or update sales orders in Dynamics 365 Business Central. The data must be supplied in the Dynamics 365 Business Central Sales Order XML format.
Sales orders are matched based on the following XML elements, in the order listed: Id
, ExternalId
, Number
, ExternalDocumentNumber
. If a match is found, the existing sales order will be updated. If not, a new sales order will be created.
When updating existing sales orders, the sales order lines are matched based on the following XML elements, in the order listed: Id
, ExternalId
, Sequence
, ItemId
. If a match is found, the existing sales order line will be updated. If not, a new sales order line will be created.
Settings
Dynamics 365 Business Central Connection
Required
The connection to Dynamics 365 Business Central to use. See the Connecting to Dynamics 365 Business Central article if you require more information on how to create/manage connections.
Fail File
Required
The name of a file for records that fail to import to be output to. The data will be in the same XML format as the input file.
Input File
Required
The file containing the records that you want to import into Dynamics 365 Business Central. The records must be supplied in the XML format shown below.
Success File
Required
The name of a file for successfully imported records to be output to. The data will be in the same XML format as the input file.
Auto Create Customers
Required
Set to true to have the task automatically create new customers if they do not already exist, and have been provided within the Customer
or BillToCustomer
element of the XML. Setting this to false will cause the record to fail import if the customers do not already exist.
Note
The CustomerId
, CustomerNumber
, BillToCustomerId
and BillToCustomerNumber
elements take precedence over data provided in the Customer
and BillToCustomer
elements. They should not be specified if you want to auto create customers.
Auto Create Items
Required
Set to true to have the task automatically create new items if they do not already exist, and have been provided within the Item
element of the XML. Setting this to false will cause the record to fail import if any of the items does not already exist.
Note
The LineObjectNumber
element takes precedence over data provided in the Item
element. It should not be specified if you want to auto create items.
Auto Ship And Invoice
Required
Set to true to have the task automatically ship and invoice each record.
Match Customers On
Optional
The list of fields to use to try and find an existing customer in Dynamics 365 Business Central which matches with the customer in the input file. These settings will only be used if the customer Id and Number are not provided in the input file, and the external ID is not found in the truth table. When multiple fields are selected, only customers where the value of all the fields match will be considered a match. The following fields are supported:
- DisplayName
- PhoneNumber
Prevent Reprocessing
Required
Set this to 'True' to check the value specified in the ExternalId
element in the XML against the truth table to see if it has already been processed, and if so skip the record.
Zynk Settings
Examples
Sample input file, for full documentation see Dynamics 365 Business Central Sales Order XML:
<?xml version="1.0"?>
<SalesOrders>
<SalesOrder>
<Id>013026b6-b0bd-ed11-9a88-6045bd0ac1f7</Id>
<ExternalId>12349</ExternalId>
<Number>101006</Number>
<ExternalDocumentNumber>TEST0001</ExternalDocumentNumber>
<OrderDate>2023-03-07T00:00:00</OrderDate>
<PostingDate>2023-03-07T00:00:00</PostingDate>
<CustomerId>d4f4fd40-34bc-ed11-9a88-6045bd0cf992</CustomerId>
<CustomerNumber>C00020</CustomerNumber>
<Customer>
<ExternalId>5230</ExternalId>
<Number>C00020</Number>
<DisplayName>Zynk Software</DisplayName>
<Type>Company</Type>
<AddressLine1>Office 16</AddressLine1>
<AddressLine2>6 Charlotte Square</AddressLine2>
<City>Newcastle</City>
<State>Tyne & Wear</State>
<Country>GB</Country>
<PostalCode>NE1 4XF</PostalCode>
<PhoneNumber>0191 303 2920</PhoneNumber>
<Email>[email protected]</Email>
<Website>www.zynk.com</Website>
<TaxLiable>false</TaxLiable>
<TaxAreaId>0015deb9-611d-ea11-bb2d-000d3a4884fc</TaxAreaId>
<TaxAreaDisplayName>Domestic customers and vendors</TaxAreaDisplayName>
<TaxRegistrationNumber>GB111111111</TaxRegistrationNumber>
<CurrencyId>00000000-0000-0000-0000-000000000000</CurrencyId>
<CurrencyCode>GBP</CurrencyCode>
<PaymentTermsId>f997d7da-549e-ed11-988a-000d3a3885d3</PaymentTermsId>
<ShipmentMethodId>ae98d7da-549e-ed11-988a-000d3a3885d3</ShipmentMethodId>
<PaymentMethodId>c48d3bdf-549e-ed11-988a-000d3a3885d3</PaymentMethodId>
<Blocked> </Blocked>
</Customer>
<BillToCustomerId>d4f4fd40-34bc-ed11-9a88-6045bd0cf992</BillToCustomerId>
<BillToCustomerNumber>C00020</BillToCustomerNumber>
<BillToCustomer>
<ExternalId>5230</ExternalId>
<Number>C00020</Number>
<DisplayName>Zynk Software</DisplayName>
<Type>Company</Type>
<AddressLine1>Office 16</AddressLine1>
<AddressLine2>6 Charlotte Square</AddressLine2>
<City>Newcastle</City>
<State>Tyne & Wear</State>
<Country>GB</Country>
<PostalCode>NE1 4XF</PostalCode>
<PhoneNumber>0191 303 2920</PhoneNumber>
<Email>[email protected]</Email>
<Website>www.zynk.com</Website>
<TaxLiable>false</TaxLiable>
<TaxAreaId>0015deb9-611d-ea11-bb2d-000d3a4884fc</TaxAreaId>
<TaxAreaDisplayName>Domestic customers and vendors</TaxAreaDisplayName>
<TaxRegistrationNumber>GB111111111</TaxRegistrationNumber>
<CurrencyId>00000000-0000-0000-0000-000000000000</CurrencyId>
<CurrencyCode>GBP</CurrencyCode>
<PaymentTermsId>f997d7da-549e-ed11-988a-000d3a3885d3</PaymentTermsId>
<ShipmentMethodId>ae98d7da-549e-ed11-988a-000d3a3885d3</ShipmentMethodId>
<PaymentMethodId>c48d3bdf-549e-ed11-988a-000d3a3885d3</PaymentMethodId>
<Blocked> </Blocked>
</BillToCustomer>
<SellToAddressLine1>6 Charlotte Square</SellToAddressLine1>
<SellToCity>Newcastle Upon Tyne</SellToCity>
<SellToState>Tyne & Wear</SellToState>
<SellToCountry>GB</SellToCountry>
<SellToPostCode>NE1 4XF</SellToPostCode>
<ShipToName>Zynk Software</ShipToName>
<ShipToContact>John Smith</ShipToContact>
<ShipToAddressLine1>6 Charlotte Square</ShipToAddressLine1>
<ShipToCity>Newcastle Upon Tyne</ShipToCity>
<ShipToState>Tyne & Wear</ShipToState>
<ShipToCountry>GB</ShipToCountry>
<ShipToPostCode>NE1 4XF</ShipToPostCode>
<CurrencyId>00000000-0000-0000-0000-000000000000</CurrencyId>
<CurrencyCode>GBP</CurrencyCode>
<PaymentTermsId>0398d7da-549e-ed11-988a-000d3a3885d3</PaymentTermsId>
<PaymentTerm>
<Code>COD</Code>
</PaymentTerm>
<ShipmentMethodId>b598d7da-549e-ed11-988a-000d3a3885d3</ShipmentMethodId>
<ShipmentMethod>
<Code>DELIVERY</Code>
</ShipmentMethod>
<Salesperson>JO</Salesperson>
<PartialShipping>true</PartialShipping>
<RequestedDeliveryDate>2023-04-01T00:00:00</RequestedDeliveryDate>
<DiscountAmount>0</DiscountAmount>
<PhoneNumber>0191 820 1484</PhoneNumber>
<Email>[email protected]</Email>
<SalesOrderLines>
<SalesOrderLine>
<Id>1b3026b6-b0bd-ed11-9a88-6045bd0ac1f7</Id>
<ExternalId>12347-1</ExternalId>
<Sequence>10000</Sequence>
<ItemId>6dcffb3a-d0bc-ed11-9a88-6045bd0cf992</ItemId>
<Item>
<ExternalId>TEST001</ExternalId>
<Number>TEST001</Number>
<DisplayName>Test Product</DisplayName>
<Type>Inventory</Type>
<ItemCategoryId>2b18deb9-611d-ea11-bb2d-000d3a4884fc</ItemCategoryId>
<ItemCategoryCode>MISC</ItemCategoryCode>
<Blocked>false</Blocked>
<Gtin />
<UnitPrice>100.0</UnitPrice>
<PriceIncludesTax>false</PriceIncludesTax>
<UnitCost>50.0</UnitCost>
<TaxGroupId>2c8e3bdf-549e-ed11-988a-000d3a3885d3</TaxGroupId>
<TaxGroupCode>STANDARD</TaxGroupCode>
<BaseUnitOfMeasureId>2d8c3bdf-549e-ed11-988a-000d3a3885d3</BaseUnitOfMeasureId>
<BaseUnitOfMeasureCode>PCS</BaseUnitOfMeasureCode>
</Item>
<AccountId>f9b2e6b3-611d-ea11-bb2d-000d3a4884fc</AccountId>
<Account>
<Id>f9b2e6b3-611d-ea11-bb2d-000d3a4884fc</Id>
<Number>10100</Number>
</Account>
<LineType>Item</LineType>
<LineObjectNumber>TEST001</LineObjectNumber>
<Description>Test Product</Description>
<UnitOfMeasureId>2d8c3bdf-549e-ed11-988a-000d3a3885d3</UnitOfMeasureId>
<UnitOfMeasureCode>PCS</UnitOfMeasureCode>
<UnitPrice>100</UnitPrice>
<Quantity>1</Quantity>
<DiscountAmount>0</DiscountAmount>
<DiscountPercent>0</DiscountPercent>
<TaxCode>STANDARD</TaxCode>
<ShipmentDate>2023-04-01T00:00:00</ShipmentDate>
<ShipQuantity>1</ShipQuantity>
</SalesOrderLine>
</SalesOrderLines>
</SalesOrder>
</SalesOrders>