Allow RelatedID mapped fields to disallow pulls

Created on 22 April 2022, about 2 years ago
Updated 21 June 2024, 6 days ago

Problem/Motivation

The RelatedID mapping is incredibly powerful, but also complicated. We have regular use cases where there are "incomplete" objects in Salesforce that we don't want to pull up. For example, campaign memberships for contacts that don't have email addresses. We block contacts with no emails from pulling into Drupal, but their campaign memberships try to pull up anyway. Those matching entities in Drupal can't exist without a person on the other end, so we keep writing versions of the same pullPrepull subscriber to block these records until their related item has a corresponding Drupal entity.

I'd like to be able to enable this very specific behavior with a checkbox on the field mapping.

The attached patch provides this facility, and opens the door to other field-level mapping behaviors using interfaces.

After applying this patch, you'll see a checkbox "Confirm Drupal Endpoint Exists" on RelatedID field mappings. Check the box, and any attempts to update or create Drupal records from Salesforce before the related object exists will be rejected, and a warning written to the logs.

✨ Feature request
Status

Needs review

Version

5.1

Component

salesforce_pull.module

Created by

πŸ‡ΊπŸ‡ΈUnited States gcb

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024