On this page
Custom tables let you display additional accounting-system data on a device, such as a sales plan or an analytical report. Each table gets a separate main menu entry. This feature is available with Medium and Full client licenses.
The integrator chooses each custom table's name. Below,
ct_sales_planis only an example for the Sales plan table, not a reserved or required name. Choose a technical name for your table and use it consistently in the filename,<table name>attribute,<name>element and<db name>profile entry.
Required files
| File | Prepared by | Purpose |
|---|---|---|
| Your table's data file | Accounting system. | Table data in tabular XML format. The integrator chooses the filename. |
custom_tables.xml | Integrator. | The list of custom tables and their menu titles. |
exchange.xml | Integrator. | A profile to download data and custom_tables.xml. |
Place all files directly in the device's configured outbox. The table data and its entry in custom_tables.xml must use the same name.
| Where the name is used | Sales plan table example |
|---|---|
| Data file | ct_sales_plan.xml |
| Data root element | <table name="ct_sales_plan"> |
Entry in custom_tables.xml | <name>ct_sales_plan</name> |
Download in exchange.xml | <db name="ct_sales_plan"/> |
Table data
Below is a data file example for the Sales plan table. The name ct_sales_plan is used only for this example:
<?xml version="1.0" encoding="utf-8"?>
<table name="ct_sales_plan">
<schema>
<field name="product_name" type="TEXT"/>
<field name="plan" type="REAL"/>
<field name="actual" type="REAL"/>
</schema>
<data>
<record>
<f>Water 1 L</f>
<f>500</f>
<f>420</f>
</record>
<record>
<f>Juice 1 L</f>
<f>300</f>
<f>315</f>
</record>
</data>
</table>
Use Latin letters, digits and underscores for your own table names, starting with a letter. The ct_ prefix is optional, but helps distinguish custom tables from standard ones. For example, a sales report could use sales_report: the filename would be sales_report.xml, and the name attribute would be sales_report.
The integrator defines field names. In every record, the number and order of <f> elements must match <schema>. The file encoding must match encoding in the XML declaration.
Menu entries — custom_tables.xml
<?xml version="1.0" encoding="utf-8"?>
<custom-tables>
<table>
<name>ct_sales_plan</name>
<label>Sales plan</label>
</table>
</custom-tables>
<name>— the table name without.xml, rather than a filename with its extension.<label>— the main menu entry's text.
For several tables, add separate <table> elements to the same file. Each must have one nonempty <name> and one nonempty <label>. Do not repeat table names. Every listed table must have its own data file in outbox.
custom_tables.xml defines the complete list of menu entries. When updating it, keep all custom tables that should remain in the menu.
Exchange profile
Add this profile inside <palm-client> in your exchange.xml. It contains one custom table from the example; replace ct_sales_plan with your own name:
<exchange name="custom_tables" view="Download additional tables">
<get>
<dbs>
<db name="ct_sales_plan"/>
</dbs>
<files>
<file name="custom_tables" files="custom_tables.xml"/>
</files>
</get>
</exchange>
Download the table as a <db> and custom_tables.xml as a <file>. Keep the default storage location for the configuration file: do not add storage="external" or destinationFolder.
You can also add these elements to an existing profile. If you have several tables, list each in <dbs>.
Download and appearance
- Place the data file and
custom_tables.xmlin the device'soutbox. - Update
exchange.xmland run Download exchange file on the device. - Run the Download additional tables profile and check the exchange log on the device.
- Return to the main menu and open the entry named in
<label>. - Open column settings from the table menu. Set readable titles, order, visibility and formats. In this example, choose decimal number for
planandactual, and text forproduct_name.
The current tables_columns.xml import configures standard tables. Custom table columns are configured on the device. New fields initially appear under their technical names.
The table supports viewing, sorting, filtering and column settings. Data updates come from the accounting system through the same exchange profile.
Hierarchical table
To display groups and nested records, add code, parent and group to the schema. Follow the rules for hierarchical references: an empty parent for the top level, the parent group's code for a nested record, group=0 for an item and group=1 for a group.
When all three fields are present, the application recognizes a hierarchical table. Do not add them to a flat report unless needed.
If the table did not appear
Start with the exchange log on the device and the server log at the download time.
| Symptom | What to check |
|---|---|
| No menu entry | Whether custom_tables.xml was downloaded, the <name> and <label> values, and the Medium or Full client license. Return to the main menu after the exchange. |
| The entry exists, but there is no data | Whether your table is listed in the profile's <get><dbs>, its file exists in outbox, and the table name matches across all files. |
| Configuration file error | The <custom-tables> root, nonempty <name> and <label>, no duplicates, and all listed tables present in outbox. |
| Numbers or dates look wrong | The format of the relevant columns in the device's table settings. |
| Records are missing in the hierarchy | Parent group codes, an empty parent at the top level, and group values. |
