Loading

Integration User Contact Insert Fails With CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY and No Debug Logs

Дата публикации: Jul 29, 2026
Описание

A custom WooCommerce integration authenticates as a Salesforce Integration-license user and calls the API to create a Contact. The request omits any record type. Object-level Create on Contact is granted through a permission set, yet the insert fails and produces no debug log, while an admin succeeds with the identical payload.

The error message changes as access is added, which is the key diagnostic signal:

  • Before any record-type access: entity type cannot be inserted: Contact — the user has no access to any Contact record type.
  • After assigning the record type on the permission set: record type missing for: Contact — the user can now use the record type, but none is being resolved at insert.

Root-cause chain:

  1. Contact has an active record type (here, Individual — the only active Contact record type).
  2. When an object has an active record type, a non-admin user must (a) have access to at least one record type and (b) have a record type resolved at insert time.
  3. A permission set grants record-type access, but it cannot set a default record type. The default is a profile-only setting.
  4. The Minimum Access - API Only Integrations profile (and the Salesforce Integration license generally) cannot carry a default Contact record type, so with no record type in the request there is nothing to resolve, and the insert is rejected.
  5. This rejection happens at the pre-DML validation stage, before triggers, flows, and Apex run — which is why no debug log is produced and why a before-save flow cannot supply the record type.
  6. A System Administrator falls back to the master record type automatically, so the admin test succeeds and masks the cause.
Решение

Supply the record type explicitly on the create request. For a Salesforce Integration-license user there is no profile default to fall back on and no earlier automation hook to set it, so the request itself must carry the record type.

  1. Confirm which user the integration actually authenticates as (check Login History at the time of a failing call). Apply all permission work to that user, not a similarly named one.
  2. On the permission set assigned to that user, under Object Settings → Contacts → Record Types, assign the active record type (Individual) with Create on Contact.
  3. In the integration's connection configuration, include RecordTypeId in the Contact create request, set once to the fixed Id of the active record type. This is a single static value, not per-record logic, and is the standard pattern for Integration-license users.
  4. Drop any id key from create payloads — a create call that specifies an Id is rejected with "The Id field should not be specified" (an empty string is tolerated, but omitting the key is cleaner).
  5. Re-run one create; the Contact should insert successfully.

Notes on approaches that do not work for this user type:

  • Setting a default record type on the profile is not possible — the Minimum Access - API Only Integrations profile has no Contact object entry and cannot hold a default.
  • A before-save flow that stamps the record type does not help, because the record-type validation runs before flows execute.
  • The RecordTypeId is org-specific. When promoting to production, look up the production Id of the same record type (Setup → Object Manager → Contact → Record Types) and use that value; the sandbox Id will not match.

The same pattern applies to any object with an active record type that this integration user writes to (for example Opportunity/Donation): supply the correct RecordTypeId on the request and ensure the assigned permission set grants access to that record type.

Дополнительные ресурсы
Add relevant Salesforce Help links (record types and record-type access for permission sets; Salesforce Integration user license and the Minimum Access - API Only Integrations profile).
Номер статьи базы знаний

005390219

 
Загрузка
Salesforce Help | Article