
In ComposeEntity, documents function are tightly integrated with accumulation registers, and the system smartly automates most of the underlying data flow. This article walks through how documents operate in ComposeEntity using utility expense and payment examples.
Core Objects Involved
We will use the following four entities to illustrate document behavior:
- UtilityCharge — a document representing a utility expense.
- UtilityPayment — a document representing a payment made for utilities.
- MyPayments (Balance) — an Accumulation Register that logs financial activity related to utilities.
- UtilityReport — a CursorReport that displays analytical data such as address, utility provider, and financial movements within a period.
Automatic Register Posting
ComposeEntity automatically posts data to accumulation registers when documents are processed. For example:
- When a UtilityCharge document is posted, it creates entries in the MyPayments register with the movement type set as
Expense
.
- When a UtilityPayment document is posted, it records entries in the same MyPayments register but with the movement type
Income
.
This dual usage of a single register by different documents helps consolidate reporting and ensures data integrity.
Handling Detail Tables
Documents in ComposeEntity may include detail tables (child records), such as line items or service breakdowns. The system intelligently processes these detail records during register posting:
- If the register fields match the names of fields in the document's header or detail table, ComposeEntity automatically creates the necessary register entries.
- It replicates shared header fields into each register record derived from detail table rows.
- No manual code is needed for this behavior — the system's internal mapping handles it based on naming conventions.
This automatic mapping saves time, reduces the chance of error, and ensures consistency across documents and registers.
Example: Monthly Utility Report