Entity mapping JSON schema

Entity mapping JSON schema

Each Bullhorn entity you want to synchronize is configured with a mapping. The record identifies the entity and direction; the details of how fields move between the two systems live in the Mapping JSON field.

Deployable mappings

Every mapping is a BH Entity Mapping Config (BH_Entity_Mapping_Config__mdt) Custom Metadata record. Mappings can be included in change sets, source deployments and package versions. There is no custom-object mapping store and no runtime override layer.

The package delivers seven Custom Metadata defaults automatically. ClientCorporation, ClientContact and Candidate are active inbound mappings. JobOrder, Placement, Certification and CandidateCertification are inactive because they depend on 3B Onboarding objects and implementation-specific companion fields. No post-install seed script is required.

The visual mapping workspace validates the mapping and submits an asynchronous Custom Metadata deployment. Invalid mappings are not deployed. Because metadata deployment is asynchronous, the previous value can remain visible briefly after saving; refresh the list after the deployment completes.

Saving through the workspace requires Customize Application or Modify Metadata Through Metadata API Functions. To stop syncing an entity, edit its metadata record and clear Active. The workspace does not offer Delete because Salesforce's Apex Metadata API supports creating and updating Custom Metadata records but not deleting them; records can be removed through Setup, a change set or a source deployment when necessary.

To migrate an existing mapping through a change set:

  1. Create or edit a BH Entity Mapping Config record in Setup with its Entity Name, Direction, Active, SF Object, Schema Version and Mapping JSON values.
  2. Add the Custom Metadata record to the outbound change set. Salesforce includes the corresponding type as a dependency.
  3. Deploy and validate in the target org.
  4. Confirm the target org shows the deployed record under BH Entity Mapping Config.

The mapping record

Field Purpose
Entity Name The Bullhorn entity name, for example ClientCorporation, ClientContact, Candidate, Placement. Must match Bullhorn exactly.
SF Object The Salesforce object API name the entity maps to.
Direction Inbound (Bullhorn to Salesforce), Outbound (Salesforce to Bullhorn) or Bidirectional. Only Inbound and Bidirectional mappings are included in the Bullhorn event subscription.
Active Only active mappings take part in synchronization. Deactivate a mapping to pause that entity without deleting the configuration.
Mapping JSON The JSON document described below.

Mapping JSON reference

{
  "sfObject": "Contact",
  "externalIdField": "External_ID__c",
  "recordTypeDeveloperName": "Candidate",
  "suppressField": "Suppress_Sync__c",
  "deleteField": "Is_Deleted__c",
  "careAboutFields": ["firstName", "lastName", "email"],
  "fetchFields": "id,firstName,lastName,email,clientCorporation(id)",
  "fieldMap": { "id": "External_ID__c", "lastName": "LastName", "address.city": "MailingCity" },
  "computedFields": { "FirstName": { "from": ["firstName", "middleName"], "join": " " } },
  "dateFields": { "dateOfBirth": "Birthdate" },
  "valueMaps": { "status": { "Active": "Current" } },
  "transforms": { "Some_Field__c": "myns.MyTransformer" },
  "dependencies": [
    {
      "sfObject": "Account",
      "bhEntity": "ClientCorporation",
      "path": "clientCorporation.id",
      "sfField": "AccountId",
      "resolveVia": "External_ID__c",
      "required": true
    }
  ],
  "uniqueAssociation": { "fields": ["candidate", "jobOrder"] },
  "filter": { "status": ["Active", "Placed"] }
}
Key Required Meaning
sfObject Yes Salesforce object API name.
externalIdField Yes Salesforce external id field that stores the Bullhorn record id. This is the join key for all upserts.
fieldMap Yes (or computedFields) Bullhorn field or dotted path -> Salesforce field. Dotted paths such as address.city read nested Bullhorn data.
computedFields No Salesforce field built from one or more Bullhorn paths joined with join.
dateFields No Bullhorn date field -> Salesforce date, date/time or time field. Bullhorn timestamps are epoch milliseconds; the engine looks at the Salesforce field type and converts accordingly: Date fields get the calendar date (noon UTC anchored), Datetime fields keep the full timestamp, Time fields keep the GMT time of day. A field key must appear in dateFields or fieldMap, never both; validation rejects the overlap. In the visual builder this is the Date/time toggle on a field map row.
filter No Record filter for inbound syncing. Each entry is a Bullhorn field or dotted path with one allowed value or a list of values (a list acts as OR); a record must match every entry to sync. Non-matching records are finalized as Skipped - they are never created or updated and never consume retries. Values compare case-insensitively. Every filtered path must also be present in fetchFields; validation enforces this. Applies to live events and backfills alike. Deletes are never filtered.
careAboutFields No For inbound UPDATED events only: the Bullhorn fields worth reacting to. Updates that touch none of these fields are recorded as Skipped instead of processed. Leave it out to treat every update as relevant.
fetchFields No The Bullhorn fields parameter used when the engine fetches the entity.
valueMaps No Per-field value translation, for example Bullhorn Active to Salesforce Current.
transforms No Salesforce field -> Apex transformer class for custom conversions.
dependencies No Parent records that must exist first. path reads the parent id from the Bullhorn payload, sfField is the lookup on the mapped object, resolveVia is the external id field on the parent (defaults to External_ID__c). required defaults to true.
suppressField / deleteField No Optional checkbox fields used for echo suppression and soft-delete tracking. Absent means the feature is off.
uniqueAssociation No For entities such as Placement where Bullhorn enforces uniqueness on a field pair, including soft-deleted rows.

Validation

Mappings are validated before use. Validation checks that the core keys are present, that dateFields keys do not collide with fieldMap, that every dependency defines sfObject, bhEntity, path and sfField, that every filter path is also fetched via fetchFields, and that the Salesforce object and every referenced field actually exist in the org. Errors are returned as a plain-language list so they can be fixed one by one.

Notes for administrators