Skip to main content

Reflecta - Send order

Reflecta Connector - SendOrderToBackoffice This process transmits an App4Sales order to the Reflecta backoffice system. It generates an XM...

Updated over a week ago

Reflecta Connector - SendOrderToBackoffice

This process transmits an App4Sales order to the Reflecta backoffice system. It generates an XML file containing the order details and uploads it to a specified FTP/SFTP server location. The connector does not handle order acknowledgements, surcharges, or attachments.

Data Source Configuration

The connector generates an XML file locally and then uploads it.

  • Local Path: The XML file is temporarily created at [App4SalesFiles]\ExportedOrders\[ApplicationName]\[OrderNr].xml, where [App4SalesFiles] is a system-level file path, [ApplicationName] is the application instance name, and [OrderNr] is the App4Sales order number.

  • FTP/SFTP Endpoint: The generated XML file is uploaded to an FTP or SFTP server. The connection details (host, port, username, password, and encryption method like TLS/SSL) are configured in the administration settings. The file is placed in the /orders/ directory relative to the folder path specified in the administration address.

Data Mapping Tables

Order Header

App4Sales Field

Source Field (XML Node)

Logic/Notes

Order Number

OrderHeader.WebOrderNr

Mapped from Order.OrderNr. If the order number is empty, a new one is generated by the system.

Customer Code

OrderHeader.CustomerCode

Mapped from Order.Customer.CustomerCode.

Order Date

OrderHeader.OrderDate

Mapped from Order.OrderDate and formatted as 'yyyy-MM-dd'.

Currency

OrderHeader.CurrencyCode

The currency code is retrieved from the customer's data stored in App4Sales (CustomersContext.Instance.GetCustomerCurrency).

Company Code

OrderHeader.CompanyCode

A mandatory value taken from the connector setting CompanyCode. Order sending will fail if this is not set.

Order Lines

App4Sales Field

Source Field (XML Node)

Logic/Notes

Line Sequence

OrderLine.OrderLineSeq

A sequential number is generated for each line, starting from 1.

Item Code

OrderLine.ItemCode

Retrieved from the item's ExtraData field where the key is 'ItemCode'. The sync will fail if ExtraData is missing for any line.

Quantity

OrderLine.OrderedQuantity

Mapped from OrderLine.Quantity. The value is converted to an integer.

Price

OrderLine.SalesPrice

Mapped from OrderLine.Price.

Dimension

OrderLine.ItemDimension

Retrieved from the item's ExtraData field where the key is 'ItemDimension'.

Dimension Size

OrderLine.ItemDimensionSize

Retrieved from the item's ExtraData field where the key is 'ItemDimensionSize'.

Delivery Date

OrderLine.EarliestDeliveryDate

Hardcoded to the main Order.OrderDate, formatted as 'yyyy-MM-dd'.

Delivery Address

A delivery address is only included if an alternate address (Order.AlternateAddress) is specified on the order.

App4Sales Field

Source Field (XML Node)

Logic/Notes

Customer Name

DeliveryAddress.Name

Mapped from the main Order.Customer.CustomerName.

Street

DeliveryAddress.Street

The street part of AlternateAddress.AddressLine1. The connector attempts to separate the house number from the street name.

House Number

DeliveryAddress.HouseNr

The house number part of AlternateAddress.AddressLine1. Assumes the house number is the last word in the address line and contains a digit.

City

DeliveryAddress.City

Mapped from AlternateAddress.City.

Postal Code

DeliveryAddress.ZipCode

Mapped from AlternateAddress.PostCode.

Country

DeliveryAddress.CountryIsoCode

Mapped from AlternateAddress.Country.

Special Logic & Filters

  • Order Number Generation: If an order is sent without an OrderNr, the system will generate one and save it to the order before proceeding.

  • Mandatory Item Data: The process will fail if any item on the order is missing its ExtraData. This field is used to retrieve the correct backoffice ItemCode, ItemDimension, and ItemDimensionSize.

Domain Specifics

Order Header Logic

The order header is built with basic information. The CompanyCode is a critical setting that must be configured for the integration to work.

Line & Pricing Logic

The connector maps the quantity and price directly from the App4Sales order line. It relies on item ExtraData to populate ERP-specific item identifiers. No complex price calculations, discounts, or VAT logic are performed in this process.

Charges & Attachments

The connector does not process or send any surcharges (e.g., freight, payment fees) or attachments (e.g., PDFs, images).

Responses & Error Handling

The connector does not process any response from the backoffice. If the FTP/SFTP upload fails, the connector will reset the order number in the App4Sales database. This allows the user to attempt to send the order again, and a new order number will be generated on the next attempt. The error message from the FTP server is returned to the user.

Related Settings & Prerequisites

The following settings from the administration configuration are used:

  • CompanyCode: The company code to identify the administration in Reflecta. This is mandatory.

  • Address: The full FTP/SFTP URL, including the folder path on the server (e.g., sftp://ftp.example.com/topfolder).

  • Username: The username for the FTP/SFTP server.

  • Password: The password for the FTP/SFTP server.

  • UseTLS / UseSSL: Flags to enable TLS or SSL encryption for FTP connections.

  • FtpActiveConnection: A boolean to switch between active and passive FTP modes.

Known Limitations

  • The connector does not handle discounts, either on the line or total order amount.

  • Surcharges and other fees are not included.

  • No attachments are sent with the order.

  • There is no logic to handle payments.

  • The connector does not wait for or process any acknowledgement from the backoffice system to confirm the order was successfully received or created in the ERP.

Did this answer your question?