Sync HOSS invoices to Salesforce on schedule

UtilitiesDeveloperCRMMarketingSalesAccounting

What it does

When a scheduled interval triggers, this automation fetches invoice headers from SQL Server and syncs them to Salesforce. For each invoice, it checks whether the sales rep exists and sends an email if the ID is missing.

Who it's for

Accounting teams who need invoices from HOSS to stay in sync with Salesforce without manual updates.

How teams use this

Keep Salesforce invoices current daily

Run the sync every morning so Salesforce has the latest invoices from HOSS without someone opening SQL Server or Salesforce manually. The team sees up-to-date records in their CRM.

Alert when sales rep data is incomplete

When a sales rep ID is missing from Salesforce, send an email so the team knows to add it before the invoice syncs. This prevents incomplete records in Salesforce.

Sync invoices to Sage Intacct as well

Add Sage Intacct as a second destination so invoices land in both Salesforce and the financial system. Include all line items and vendor details in the Sage Intacct record.

Run sync only for specific invoice types

Filter the SQL Server query to only sync invoices with a certain status or type, so the automation skips drafts or internal records. This keeps Salesforce focused on billable invoices.

How it works

  1. Run on a specified interval. This automation starts at the scheduled time you set, then looks up the runtime parameters needed for the sync.
  2. Fetch invoice headers from SQL Server. Select rows from the hoss.QI_HDR table in SQL Server. For each invoice header, the automation looks up the sales rep ID and fetches vendor details from the hoss.VENDOR table.
  3. Check sales rep in Salesforce. For each invoice, check whether the sales rep ID from SQL Server is present in Salesforce. If the ID is missing, send an email alert. If it exists, upsert the invoice record.
  4. Upsert invoice to Sage Intacct. Send the synced invoice data to Sage Intacct so the financial records stay current across both systems.
  5. Fetch invoice line items. Select rows from the hoss.QI_DET table in SQL Server to retrieve invoice details and complete the sync with all line-item data.