How it works

1. A schedule trigger checks Salesforce every hour for new or updated opportunities. 2. A For Each loop goes through the records found. 3. A condition keeps only opportunities at Closed Won. 4. A second condition skips opportunities whose description already holds an invoice reference. 5. Salesforce returns the account that owns the opportunity. 6. QuickBooks is searched for a customer matching the account. 7. If there is no customer, one is created. 8. A QuickBooks invoice is created for the deal. 9. The opportunity is updated with the invoice reference.