Baan Connector - SendOrderToBackoffice
This document describes the process of sending an order from App4Sales to the Baan ERP system. The connector constructs an XML message from the App4Sales order and sends it to the Baan web service.
Data Source Configuration
The connector sends orders to a Baan SOAP web service. The URL for this service is configured in the administration settings.
Order Header Logic
The order header information is mapped to the main part of the XML message.
App4Sales Field | Source Field (API/Excel/DB) | Logic/Notes |
- | (multiple) | The entire App4Sales order is converted to an XML structure. |
Date | Order.Date | The date is formatted by removing dashes (e.g., '2023-10-27' becomes '20231027'). |
OrderedBy Date | Order.OrderedBy.Date | The date is formatted by removing dashes (e.g., '2023-10-27' becomes '20231027'). |
Login Name | InternalRequest | The login name for the web service call is determined based on the application. For 'Mood4Sales' or 'Portal4Sales', it attempts to use the customer's manager from the database; otherwise, it uses the username from the request. For other apps, it directly uses the username from the request. |
Line & Pricing Logic
Order lines are mapped to a corresponding structure within the XML message. The provided code does not contain specific details on the mapping of individual line fields. It passes the generated XML to the web service.
App4Sales Field | Source Field (API/Excel/DB) | Logic/Notes |
(not specified) | (not specified) | The connector sends the order lines as part of the XML document to the Baan web service. The exact mapping is not detailed in the connector code itself but is expected to be handled by the receiving service. |
Responses & Error Handling
The connector handles the response from the Baan web service and updates the order in App4Sales.
Action | Details |
Successful Response | The returned order number from the Baan web service is stored in the App4Sales database for the corresponding order. |
Error Response | If the web service call fails or returns an error, the error message is captured. The process returns a string starting with 'ERROR:'. |
Missing Order XML | If the initial order XML is not provided to the function, it immediately returns the error message "ERROR: No OrderXML found!". |