AnalyticsRule
Updated
Which cost centre, project and cash-flow item a document takes when it names none. A rule has the documents it is for, conditions, and what it sets; the rule with the most conditions met wins.
| Kind | Dictionary |
| Module | Accounting |
| Menu | General ledger → Setup → Analytics rules |
Fields#
| Field | Caption | Points at |
|---|---|---|
ID |
Code | number sequence |
Name |
Rule | string, 200, required |
Scope |
Documents | enum AnalyticsScope: any, sales, payments from customers, payments to suppliers, cash expenses, other income, stock, payroll |
LegalEntity |
Legal entity | LegalEntity |
Division |
Division | Division; a store of the division fits |
Store |
Store | Store |
Customer |
Customer | Customer |
Contract |
Contract | SalesContract |
Agent |
Agent | SalesPerson |
Supplier |
Supplier | Supplier |
CostArticle |
Cost article | CostArticle |
CostCentre |
Cost centre | the cost centre the document takes |
Project |
Project | the project the document takes |
CashFlowItem |
Cash-flow item | CashFlowItem: the item a payment takes |
Priority |
Priority | integer: the higher wins between rules with as many conditions |
IsDisabled |
Disabled | boolean |
A rule fits a document when every condition it fills is the document's. Of the rules that fit and set an analytic, the one with the most conditions wins — Scope other than any counts as one — then the higher Priority, then the earlier code; each analytic is chosen on its own. Saving refuses a rule that sets nothing, or one with Scope any and no condition.
The service AnalyticsRules answers which rule fits. CostCentres asks it for a document's cost centre and project before the division's cost centre, and CashFlowItems for a payment's item before the counterparty's, cost article's or operation's. A document takes the rule's value on save while it is a draft and keeps it once posted. There are no commands. This dictionary writes no register.