We need to figure out if multiple mappings per entity makes sense.
If it makes sense, then we need to build full support for it.

Issues around this have lingered for many years:
#2791651: Many (Drupal) to one (Salesforce) support?
#2694245: Multiple mapping for the same drupal entity
#2546266: Many to One or Many to Many needed

Comments

aaronbauman created an issue. See original summary.

Aron Novak’s picture

Component: Code » salesforce.module

From the roadmap:

Additional major goals:
- use SOAP for things that make sense
- support for multiple mappings per entity / entity type
- test all the things

Would OTM mean that let's say one Drupal User entity can be synced as two different Contact objects in Drupal?
Perhaps for Contacts, it doesn't make sense, but for other entities, it does make a lot more sense.

We have a project where we have this need, so we could provide a patch for it, if it has the chance to be part of the module, also if we interpret the OTM functionality in the same way. As I see one entity can have multiple mappings, so for a Drupal User, the module can sync a Contact and a Member record let's say.

For the mapping UI, I guess we need to be able to mark multi-value fields as part of the IDs, so if we have:
Nid: 15
MyId:
- 14
- 13
- 12

I could mark MyId as part of the Id, that way one Drupal entity can yield in multiple Salesforce object. https://pasteboard.co/GDRiB6pbO92z.png - this way for instance.
Is it inline with the OTM efforts?

Aron Novak’s picture

Version: 8.x-3.x-dev » 5.0.x-dev
Aron Novak’s picture

Thinking more about this problem domain, the original issue is clearly about multiple mappings, so to be able create multiple mappings that apply to the same Drupal entity and it should work flawlessly.
My intention is a bit different, one mapping would generate multiple Salesforce objects - via a new, additional mapping item configuration, as seen in https://pasteboard.co/GDRiB6pbO92z.png . However likely one feature would help the other, as it shares the trait of having multiple SF objects for the same Drupal entity.