Skip to content

Custom development

A tax engine rebuilt from 28 rows of configuration

The client told us the tax was calculating by product instead of by province. We tested that against all 2,335 order line items and it was not true. Six other defects were, and we priced each one.

Built for
SMT Research, Vancouver
Service line
Custom development
Window
Jun to Sep 2026
Milestone
Rate table live 2026-08-09
The headline number31%Of quote lines carried no tax code5,997 of 19,255 lines. 5,182 of them sit on Canadian job sites.

01Key numbers

What we measured

2,335Order line items tested against the reported diagnosisEvery order line item in the org. Zero non-BC orders carried BC tax treatment.
5,182Of untaxed quote lines sitting on Canadian job sites5,182 of the 5,997 lines with no tax code. Quote value excluding tax, not currency converted.
2,335Of forward pipeline set to convert with blank tax codesOpen pipeline at the time of the audit. Exposure if converted unchanged, not a loss already taken.
22Line items already taxed wrong22 Canadian line items marked zero-rated that should not have been. Money already gone, not at risk.
1Province billed without a registrationCollected on QST the company is not registered to collect. Small, and the reason the rule became a data row.

02The situation

What was true before

The client arrived with a diagnosis already written. Salesforce, they said, was working by item product and not by the province of the client. That is a specific, testable claim, so we tested it before designing anything.

It was wrong. Across all 2,335 order line items, zero orders shipping outside British Columbia carried BC tax treatment. The reported symptom was real. The stated cause was not.

The real exposure was larger and in a different place. Tax rates were hard-coded in eight places, five of which were formula fields, and one province rate had been stale since April 2025.

Contact us to find out more

Recognise this in your own org?

03What we built

The mechanism

A custom metadata rate table of 28 records, one per province and tax class, with effective dating and a registration flag.

Custom metadata, because formula fields cannot query a custom object

Five of the eight places a rate was hard-coded are formula fields. A formula cannot query a custom object, but it can reference custom metadata. Custom metadata was therefore the only store that let those formulas stop carrying literals without first rewriting the whole engine in Apex.

Statutory rate split from applied rate

The schema stores the statutory PST or QST rate separately from the rate actually applied, which is zero for Quebec, alongside a registration flag and effective dates. The Quebec rule stops being tribal knowledge and becomes a data row with a citation.

A numeric regression protocol, not a smoke test

Switchover ran in five phases. Snapshot the tax sums across all order items, deploy, re-run, compare. Any delta is treated as a bug in the mapping, not as an improvement. A rebuild that changes a number silently is a rebuild nobody can sign off.

One fix designed, costed, and deliberately not shipped

A change-request sign error understated one progress claim. The fix was written and tested and left undeployed. It changes the reported contract value on a customer-facing document, so the controller confirms first.

1Quote accepted
2Create order and lines
3Carry the tax code across
4One location and work order per segment
5Raise intake tasks from config
6Fault path: show the real errorAdded
Depiction · The quote-to-order conversion, as rebuilt. Eleven create and update steps, each with a fault path.It had no fault handling at all, so a failed conversion crashed silently and the salesperson could only report that it did not work. The error screen is why they can now say what went wrong.

Surfaces built

We will demonstrate any of these live, on the real org,.

  • The 28-record province and tax-class rate tableImage withheld
  • Line-item exposure report by province and tax codeImage withheld
  • Five-phase switchover checklist with tax-sum snapshotsImage withheld
The finding

The entire order-side tax stack was triggered by a field whose own help text says it is not used in calculations.

The trigger flow watched a formula field. That field carries help text reading "Informational purposes only. Not used in calculations." It was in fact the entry criterion for the whole order-side tax calculation. Anyone reading the org to understand it would have been told the opposite of the truth by the org itself.

04Outcome

What changed, verified

The rate table went to production on 9 August 2026. Six defects were quantified in dollars before any of them were argued about.

  • The reported diagnosis was disproved against 2,335 line items before a line of code was written.
  • Rates moved out of eight hard-coded locations into 28 configuration records with effective dates.
  • The Nova Scotia rate, stale at 15% against a 14% statutory rate since 1 April 2025, became a dated row.
  • A rate change is now a record edit. It is not a deploy.
How it was verified

Tax sums across all order items were snapshotted before each phase and compared after. Any delta was treated as a mapping bug.

Sources
  • docs/research/01-salesforce-platform.md §2.1 · Tax engine rebuild
  • docs/research/01-salesforce-platform.md §1 · Configuration in custom metadata
  • docs/research/01-salesforce-platform.md §5 · Pull quotes

Keep reading

Two more

All case studies
  • Custom development
    100%Of the order book placed on a mapFrom a starting point of zero. The book was recorded at 254 orders carrying an address and the geocoding run at 252 of 252. We have not reconciled the gap.

    An order book on a map, and the customer who was a fifth of it

    Every order had an address and none had coordinates. Once they were mapped, one account turned out to be 20% of the book and the default view was hiding another 35%.

  • Custom development
    5 to 6Systems a field technician checked each morningThe recorded before state. No after count was measured, so we do not publish one.

    Five to six systems every morning, and a flow that logged nothing

    Field crews were opening five or six systems before starting work, and a logging flow was telling them it had saved data when it had saved nothing.

Next step

Bring us your hardest Salesforce problem

Tell us what is broken. You get a written read on it within one business day, before any money changes hands.

  • Reply within one business day
  • Live walkthrough of the org itself
  • Vancouver, British Columbia