Skip to content
Vendor

Salesforce to ERP

Salesforce → ERP

Salesforce does not push vendors, service requests, or asset assignments to ERP. There is no webhook and no ERP_Integration_Setting for a Vendor Account. ERP is the caller. What comes back is the HTTP result of that call.

Record types

The first vendor upsert loads Account record types.

GET /services/data/v67.0/query?q=SELECT Id, DeveloperName FROM RecordType WHERE SObjectType = 'Account'

Salesforce answers HTTP 200. ERP keeps the Id for DeveloperName Vendor and sends it as RecordTypeId on every later vendor PATCH in that process.

{
  "totalSize": 1,
  "done": true,
  "records": [
    {
      "Id": "012000000000007AAA",
      "DeveloperName": "Vendor"
    }
  ]
}

A query that has no Vendor row fails the upsert with account record type "Vendor" not found in org.

Vendor upsert

PATCH /services/data/v67.0/sobjects/Account/Vendor_Code__c/VN-00001

A code Salesforce has never seen is HTTP 201:

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

ERP stores id on the vendor as salesforceRecordId. The create, update, or deactivate API the caller used has already been answered. A failed upsert leaves that row at syncStatus Failed. Deactivate still answers HTTP 200 with "status": "Inactive".

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

HTTP/1.1 204 No Content

ERP reads that as a failure: vendor upsert: empty id (status 204). The local row becomes Failed. The id stored from the first 201 is left in place. The Salesforce record was updated. The next sync sends the same PATCH and gets 204 again.

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

A validation failure is the Salesforce error array. On POST /api/vendors and PATCH /api/vendors/{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.