Skip to main content

ExactOnlineV2 - Customer sync

Xlsx Connector - SendOrderToBackoffice This process exports an App4Sales order into an XLSX file and uploads it to a configured FTP/FTPS/S...

Updated over a week ago

Xlsx Connector - SendOrderToBackoffice

This process exports an App4Sales order into an XLSX file and uploads it to a configured FTP/FTPS/SFTP server. A new XLSX file, named after the order number (e.g., 12345.xlsx), is created for each order.

Data Source Configuration

The system generates an XLSX file based on the App4Sales order data. This file is then uploaded to a specified folder on an FTP server.

  • Protocol: FTP, FTPS, or SFTP

  • Host/Address: Configured via the Session.Administration.Address setting. The URI scheme (ftp://, ftps://, sftp://) determines the protocol.

  • Username: Configured via the Session.Administration.Username setting.

  • Password: Configured via the Session.Administration.Password setting.

  • Target Folder: The file is uploaded to a directory named Orders on the server, relative to the user's root directory.

Data Mapping Tables

Order Header (Sheet: "Orders")

Excel Column

Source App4Sales Field

Logic/Notes

OrderNo

Order.OrderNr

If the order number is missing, a new one is generated via Session.PortalServerProvider.CalculateOrderNumber() and saved to the order.

OrderDate

Order.OrderDate

The date the order was placed.

Created

Order.SysCreated

The system timestamp when the order was created.

CustomerName

Order.Customer.CustomerName

The name of the customer who placed the order.

CustomerCode

Order.Customer.CustomerCode

The unique code of the customer.

AddressLine1

Order.AlternateAddress.AddressLine1 or Customer.MainAddress.AddressLine1

The delivery address is sourced from the order's AlternateAddress if it exists. If not, it falls back to the customer's main delivery address (where AddressType is 'Delivery' and IsMainAddress is true). If neither is available, these fields will be empty.

AddressLine2

Order.AlternateAddress.AddressLine2 or Customer.MainAddress.AddressLine2

The delivery address is sourced from the order's AlternateAddress if it exists. If not, it falls back to the customer's main delivery address (where AddressType is 'Delivery' and IsMainAddress is true). If neither is available, these fields will be empty.

AddressLine3

Order.AlternateAddress.AddressLine3 or Customer.MainAddress.AddressLine3

The delivery address is sourced from the order's AlternateAddress if it exists. If not, it falls back to the customer's main delivery address (where AddressType is 'Delivery' and IsMainAddress is true). If neither is available, these fields will be empty.

PostCode

Order.AlternateAddress.PostCode or Customer.MainAddress.PostCode

The delivery address is sourced from the order's AlternateAddress if it exists. If not, it falls back to the customer's main delivery address (where AddressType is 'Delivery' and IsMainAddress is true). If neither is available, these fields will be empty.

City

Order.AlternateAddress.City or Customer.MainAddress.City

The delivery address is sourced from the order's AlternateAddress if it exists. If not, it falls back to the customer's main delivery address (where AddressType is 'Delivery' and IsMainAddress is true). If neither is available, these fields will be empty.

State

Order.AlternateAddress.State or Customer.MainAddress.State

The delivery address is sourced from the order's AlternateAddress if it exists. If not, it falls back to the customer's main delivery address (where AddressType is 'Delivery' and IsMainAddress is true). If neither is available, these fields will be empty.

Country

Order.AlternateAddress.Country or Customer.MainAddress.Country

The delivery address is sourced from the order's AlternateAddress if it exists. If not, it falls back to the customer's main delivery address (where AddressType is 'Delivery' and IsMainAddress is true). If neither is available, these fields will be empty.

Reference

Order.Reference

The customer's reference for the order.

YourReference

Order.YourReference

The sales representative's reference for the order.

Notes

Order.Notes

General notes for the order.

Remark1

Order.Description1

Additional remarks fields on the order.

Remark2

Order.Description2

Additional remarks fields on the order.

Remark3

Order.Description3

Additional remarks fields on the order.

Vat

Order.TotalVat

The total VAT amount for the order.

Total

Order.TotalAmount

The grand total amount of the order.

SubTotal

Order.SubTotal

The total amount before VAT and shipping.

ShippingCostsIncVat

Order.ShippingCostsIncl

Shipping costs including VAT.

Order Lines (Sheet: "OrderLines")

Excel Column

Source App4Sales Field

Logic/Notes

OrderNo

Order.OrderNr

The order number, linking the line to the header.

LineNumber

OrderLine.Sequence

The sequential number of the order line.

ItemCode

OrderLine.ItemCode

The code of the item on the line.

Description

OrderLine.Description

The description of the item or a free-text entry.

Quantity

OrderLine.Quantity

The quantity of the item ordered.

Price

OrderLine.Price

The unit price of the item.

Discount

OrderLine.Discount

The discount percentage applied to the line.

Instruction

OrderLine.Instruction

Any special instructions for the order line.

Special Logic & Filters

  • Order Numbering: If an order lacks an OrderNr, a new number is generated by the App4Sales server and assigned to the order before the export. This ensures every exported file has a unique identifier.

  • File Naming: The exported XLSX file is named using the order number, for example, "SO12345.xlsx". Any characters that are invalid for file names are stripped from the order number before creating the file name.

Responses & Error Handling

  • The method returns the order number (OrderNr) as a string upon successful execution.

  • The connector does not process any response from the FTP server. If the file upload fails, an exception is thrown, and the process is halted. There is no built-in retry mechanism for FTP uploads.

Related Settings & Prerequisites

For the order export to function correctly, the following administration settings must be configured:

  • FTP Server Address (Session.Administration.Address): The full URI to the FTP server, including the protocol (e.g., ftp://ftp.example.com).

  • FTP Username (Session.Administration.Username): The username for FTP authentication.

  • FTP Password (Session.Administration.Password): The password for FTP authentication.

Did this answer your question?