Salesforce Integration
Salesforce is the system of record for customers, contacts, products, pricebooks, opportunities, and proposal attachments. The inspection app is an operational layer around that data because field users need a faster, guided interface while the company still needs Salesforce to remain authoritative for customers, catalog products, opportunity records, proposal attachments, and traceable identifiers.
Objects used
| Salesforce object | App usage |
|---|---|
| Account | Customer lookup, shipping/billing address, division/branch context |
| Contact | User provisioning and role metadata |
| Product2 | Catalog item target for inspection mappings |
| Pricebook2 | Division/customer pricebook selection |
| PricebookEntry | Active price and product availability |
| Opportunity | Submitted inspection and expert proposal container |
| OpportunityLineItem | Proposal line items |
| ContentVersion | PDF/DOCX/report attachment upload |
Data flow
Contact role fields ── provision ── app user access
Account and Opportunity ── provide ── customer and proposal context
Product2 plus PricebookEntry ── provide ── mapped item availability and price
Generated proposal file ── uploads as ── Salesforce ContentVersionAuth direction
The preferred long-term direction is OAuth client credentials through the CA Parts Integration User. Sensitive or not-yet-permitted paths can retain SOAP fallback until IT grants the required object and field permissions.
The app should prefer OAuth where permissions are present and fall back gracefully where the integration user still lacks access.
SaleID behavior
SaleID is generated by Salesforce after Opportunity creation. Proposal generation should therefore read the Opportunity after submission and wait briefly for Opportunity.SaleID__c to appear.
The current safe pattern is OAuth-first for SaleID-sensitive reads with SOAP fallback if OAuth cannot authenticate or cannot read the field.
Pitfalls
- Do not assume a Salesforce field exists immediately after Opportunity creation if Salesforce automation populates it asynchronously.
- Do not use Standard Price Book behavior when the requirement is division-specific or customer-specific pricebook behavior.
- Do not silently ignore OAuth permission failures; capture enough detail to know whether SOAP fallback masked a missing integration-user permission.
Related pages
- Admin Tools explains how mappings and pricebooks are maintained.
- Deployments explains why preview and production Salesforce environments must stay distinct.