Revenue Cloud project notebook, written by two Meir IT consultants who implement it.

What is Revenue Cloud?

Billing and Tax·Admin

Routing Invoice Lines to the Ledger

Ledger assignment rules route on what the invoice line carries, and the line carried neither the product family nor the tax zone. Bring both down first: a rule’s criteria can never be edited or deleted.

Nathan Altmann · Revenue Cloud consultant at Meir IT

Published 3 min read

In 3 linesfor leadership

  1. Accounting wanted each invoice line posted to the right GL account, by product family and tax zone.
  2. The invoice carried neither of the two criteria, and a posting rule can't be changed once it is written.
  3. Copy both criteria onto the invoice line first, then prove each rule with a real posted invoice.
In this article (6 sections)
  1. The problem
  2. The solution
  3. Setting it up
  4. The choice and its cost
  5. In practice
  6. Sources

The problem

Step: posting invoice lines to the general ledger. Finance wanted each invoice line posted to the right ledger account based on two criteria, product family and tax zone. With several product families plus the tax dimension, that meant dozens of assignment rules, maintained by an accountant rather than an admin.

Salesforce has ledger assignment rules for exactly this. The information they needed was missing: the invoice carried neither criterion. And a rule written against the wrong field can’t be fixed afterwards, which the project found out the hard way.

The solution

A ledger assignment rule can only route on what the invoice carries, and the invoice carries surprisingly little: no country field, an empty billing profile reference, and a TaxCode on the line that stays empty even after posting. The product family lives on the product and the tax zone on the account. Neither is copied onto the invoice, so a rule has nothing to match on.

The fix is to bring both dimensions down onto the invoice line with formula fields: the tax zone from the account, the accounting family from the product. Rules then match on family × zone, and each piece of data keeps a single source.

The order matters more than usual because of how the rules are stored. Their criteria can be added but never edited or deleted (details below), so a rule written before the data is on the line stays in the org for good.

Setting it up

  1. Add the two dimensions where they are maintained: the zone on the account, the family on the product.
  2. Bring them down to the invoice line as formula fields.
  3. Deactivate the rule before adding any criterion.
  4. Prove every rule with a real posted invoice. Reading the configuration proves nothing, because it accepts anything.

Two more things send a criterion to the wrong field while setting this up:

  • Invoice.BillingAccountId points at Account, not at the BillingAccount object, despite its name.
  • A newly deployed formula or custom field is invisible to SOQL and Apex until field-level security is granted. SOQL answers “No such column”, which looks exactly like a failed deployment.

The choice and its cost

Formula fields keep one source per piece of data: the zone stays on the account, the family on the product. The consequence is that routing follows the current value of the source, not the value at invoice time. For a tax zone that is usually what finance wants. For anything that must be frozen at posting, a text field written once is safer.

In practice

  • Bring routing data down onto the invoice line before writing a single rule.
  • Write each criterion once, carefully: it can never be edited or deleted.
  • Deactivate the rule before adding a criterion.
  • Post one real invoice per rule and check the ledger account it lands in.

Sources

  1. GeneralLedgerAcctAsgntRule
  2. BillingBatchFilterCriteria
  3. InvoiceLine
  4. GeneralLedgerAccount
  5. BillingBatchFilterCriteria
A technical question about this article?

A question about this article? I reply within 48 hours.

Something unclear, a mistake, or different behavior in your Salesforce org? Write to me.

Prefer email? Write to nathan@meir-it.com

Get notified of new articles

Type at least two letters.