Documentation/Getting started

For administrators

First exchange

End-to-end check: prepare outbox, download data to a device and receive an order in inbox.

This scenario checks the complete PalmOrder Server workflow: the accounting system prepares data in outbox, the device receives it, and a created order returns to inbox.

Before you begin

Make sure that:

  • PalmOrder Server is installed and running;
  • the correct inbox and outbox directories are set in the control panel;
  • the server has an active license or a demo device is available;
  • an Android device is paired with the server;
  • the device can open the server address through the local network or HTTPS.

1. Prepare tables in outbox

Write the XML tables needed to create an order directly to the outbox directory:

outbox/
├── ref_customers.xml
├── ref_products.xml
├── vl_cat_prices.xml
├── vl_delivery_types.xml
├── vl_pay_types.xml
├── vl_trade_points.xml
├── doc_debts.xml
├── doc_debts_products.xml
├── customer_product_data.xml
└── routes.xml

The accounting system must create table files with current customers, products, prices and sales points. Every file must have a <table> root element and be fully written before the exchange begins. A reliable approach is to write a temporary file first and atomically rename it to the required name after writing completes.

2. Download the prepared exchange.xml

Download the exchange.xml example and place it directly in the outbox directory with this name. It includes profiles for:

  • Send documents — orders, payments, sales receipts and files;
  • Download data — the tables listed above;
  • Download images, Download settings and Download print forms — additional files when they appear in outbox.

3. Download the exchange file

On the Android device, open Exchange and run the built-in Download exchange file action. It is available before a custom exchange.xml has been installed.

The application receives exchange.xml from outbox, validates the XML and replaces its local exchange configuration. When it finishes, the list should contain Send documents, Download data and the additional file profiles.

If the file does not download, first check that its name is exactly exchange.xml, it is in the outbox directory configured for this syncName, and its XML encoding is valid.

4. Receive tables

Run the Download data profile. For every requested name, PalmOrder Server:

  1. finds the XML file with the same name in outbox;
  2. creates an SQLite database in its own cache directory;
  3. sends the database to the paired device;
  4. reuses the cache until the source XML changes.

Every requested table should finish without errors in the device exchange log. Find events for the same syncName in the server log.

The source XML table files remain in outbox. They are not shown to the device as ordinary files and are not deleted after download.

5. Create and send an order

In PalmOrder, create an order for a customer and a product from the prepared tables. Save the document, open Exchange and run Send documents.

After successful sending, the server creates a separate XML file in inbox. Its name starts with the document type and contains syncName, for example:

order_sales-kyiv-1_6aa1d0ae1.xml

The server generates the exact time suffix, so the accounting system must not try to predict it.

6. Check the received document

Open the new file from inbox. The order must contain a header and product lines:

<?xml version="1.0" encoding="utf-8"?>
<post user="sales-kyiv-1" connType="remote">
  <docs name="order">
    <doc>
      <head>
        <field name="number" value="ЗК-1"/>
        <field name="customer_code" value="C-001"/>
      </head>
      <table>
        <row>
          <field name="code" value="P-001"/>
          <field name="count" value="2"/>
          <field name="price" value="42.5"/>
          <field name="sum" value="85"/>
        </row>
      </table>
    </doc>
  </docs>
</post>

The actual file contains the fields configured for this document type. After a successful import, the accounting system must move or delete the file according to its own processing rule so that it is not posted again.

Signs of a successful exchange

  • the device downloaded the current exchange.xml;
  • the Download data profile installed every requested table;
  • a customer and product can be selected on the device and an order can be saved;
  • the Send documents profile finished without errors;
  • an XML file with the correct document type and syncName appeared in inbox;
  • the accounting system read the document only once.

If the exchange does not complete

First open Log in the control panel. Find the event by the exchange time and device syncName: its message usually explains at which step the server stopped. If the reason is unclear, check the following:

SymptomCheck after the log
The device cannot connectAddress, port, HTTP/HTTPS, firewall access and pairing status.
exchange.xml is not foundThe outbox directory configured for syncName, the exact file name and server read permissions.
A table does not downloadThe name in <db>, XML file name, <table> root, schema and the number of <f> values in records.
An order does not appear in inboxsend_status, the inbox directory configured for syncName and write permissions.
A document arrives againWhether the application changed send_status from 0 to 1 and whether the ERP removes the processed file from inbox.