Skip to content
FOC

Salesforce to ERP

Salesforce → ERP

Salesforce does not push FOC items to ERP. There is no webhook and no ERP_Integration_Setting for FOC_Master__c. ERP is the caller. What comes back is the HTTP result of that call.

FOC upsert

PATCH /services/data/v67.0/sobjects/FOC_Master__c/FOC_Code__c/FOC-UMBRELLA

A code Salesforce has never seen is HTTP 201:

{
  "id": "a0F000000000001AAA",
  "success": true,
  "errors": [],
  "created": true
}

ERP stores id on the item as salesforceRecordId. The create or update API the caller used has already been answered with the saved row. A failed upsert leaves that row at syncStatus Failed.

A code Salesforce already has is HTTP 204 and an empty body.

HTTP/1.1 204 No Content

ERP reads that 204 as success. The local row stays Synced. The id stored from the first 201 is left in place. The Salesforce record was updated.

Any other success status with an empty id is a failure: foc upsert: empty id (status 200). The local row becomes Failed.

A failure is written to the ERP integration log. ERP does not post an Integration_Log__c for an FOC item.

A validation failure is the Salesforce error array. On POST /api/foc and PATCH /api/foc/{code} the caller still receives the saved row. On the explicit sync-to-salesforce call the answer is HTTP 500 internal_error with message internal server error.