Approved purchase orders become bills
The purchasing objects#
| Object | Fields |
|---|---|
| Purchase Order (custom, number PO-0000) | Vendor (lookup to Contact), Status (Draft, Submitted, Approved), Order Date, Terms (Net 30, Net 45), Always Bill (checkbox), Total (roll-up of the lines), QuickBooks Bill Id |
| PO Line (child of Purchase Order) | Description, Amount, Expense Category (an account name from QuickBooks) |
Step 1: Map Purchase Order to Bill#
| QBO Field | Salesforce Field |
|---|---|
| VendorRef (required) | Vendor › QuickBooks Vendor Id: the ID itself, so no name lookup is needed |
| TxnDate | Order Date |
| DocNumber | Purchase Order Number |
| DueDate | formula IF(TEXT(Terms__c) == "Net 45", Order_Date__c + 45, Order_Date__c + 30) |
- On QB Bridge Entities, pick Bill, open Mapping and choose Purchase Order in 1. Primary Salesforce Object. Map the header fields above.
- In 3. Line Item Detail Types, expand AccountBasedExpenseLineDetail and choose PO Line. Map Amount ← Amount and AccountRef ← Expense Category; add Description ← Description.
- In 4. QBO ID Storage, pick QuickBooks Bill Id as the Main Entity ID Field, then click Save Intelligent Mapping.

The Bill mapping: the header from Purchase Order and one expense line per PO Line.
Step 2: Only approved orders of $50 or more, or Always Bill#
- Build the Purchase Order Flows for create and update.
- Click the Bill Outbound to QuickBooks card. In the Bill Trigger Rules window, Automatic sync options tab, switch On Salesforce Purchase_Order__c Record Create to Enabled.
- Click + Add Condition Row three times: 1 Status Equals Approved; 2 Total Greater Or Equal 50; 3 Always Bill Equals True. Logic Formula:
1 AND (2 OR 3). - Do the same in On Salesforce Purchase_Order__c Record Update: it has its own rows and its own Logic Formula. Click Save Trigger.

Three conditions combined with a Logic Formula.
Prove it#
| Purchase order (approved) | Result |
|---|---|
| PO-0000: 1,200, Net 45, three lines | Bill PO-0000 for "Okafor, Amara (Denver)", dated 2 Dec, due 16 Jan (45 days): 800 Cost of Labor, 250 Office Expenses, 150 Automobile |
| PO-0001: 30 | No bill |
| PO-0002: 30, Always Bill | Bill PO-0002, due 1 Jan (30 days) |
| PO-0003: 210, approved without an Order Date | Bill created anyway: both dates were empty, so both were left out and QuickBooks used today's date. QB Bridge then wrote that date into the empty Order Date, because the bill date is copied back to the mapped field after a create. |

Bill PO-0000 as QuickBooks shows it: the vendor from the formula name, due 45 days after the order date, one category line per PO Line. It shows Paid because we paid it later for the delete test (When things go wrong).
Video: the same idea with the standard Order object: an activated Order becomes a bill, then the bill in QuickBooks.

PO-0000 after the tests: its lines, the bill in the QuickBooks data panel (paid in QuickBooks), and the sync history with the delete that left the paid bill unchanged.
Item lines and account lines from the same object
Bills can also have ItemBasedExpenseLineDetail lines, but each detail type you configure turns every child record into a line of that type. A PO Line without a product would become an item line without an item, which QuickBooks refuses. Use one detail type per child object, or a separate child object for item lines.
Where to next#
- When things go wrong: break it on purpose