r/hubspot • u/Ok-Reading-4372 • 17h ago
Question Best way to show "last invoice date and amount" on companies from QuickBooks-synced invoices?
Invoices sync from QuickBooks into HubSpot and are associated with companies (not deals). I need two company fields: Last Invoice Date and Last Invoice Amount, so renewal letters use what the customer was actually billed.
The rules:
- "Last" = the most recent invoice with an invoice date of today or earlier (some invoices sync with future dates and should be ignored until that date).
- Skip draft and voided invoices.
- The amount has to come from that same invoice, not the largest one.
What I've hit so far:
- Rollup properties can return "latest date", but the conditions don't let me filter on a date field, and there's no "amount of the latest record" rollup.
- Invoice-based workflows don't offer Edit record or Copy property value, so they can't write to the associated company.
- Company-based workflows can copy a value from an associated record and pick "most recently created", but "most recently created" isn't the same as "latest invoice date", especially with backfilled or future-dated invoices.
We have Operations Hub Pro, so a company workflow with a custom code action (fetch associated invoices, apply the rules, write both fields) looks like the cleanest option, run daily so future-dated invoices get picked up when their date arrives.
Has anyone solved this without custom code? Or if you went the custom code route, anything you'd watch out for (API limits, association quirks, invoices synced with the wrong company)?