Tip #729: Mapping fields in N:N relationship

Nonmonogamy relationshipsNormal out-of-box CRM relationship mapping can be extremely beneficial, but it has a very big “gotcha”. They only work when creating a child entity from the parent form. So if the user is on the parent entity form, and adding a new entity via a grid, then the mapping will automatically be populated for the user. But what happens if you have an entity that is serving as a N:N entity (think Opportunity Products). Generally, a user would create an Opportunity Product from the Opportunity Form. This means if any mappings are setup from the Product to the Opportunity Product, they will not be applied.

There is no way for this to get applied natively, since the mapping takes place before the Opportunity Product is loaded, but the user doesn’t select a Product until after the Opportunity Product is loaded. Daryl “New MVP on the block” LaBar created a simple partial work around – a plugin that performs the mapping using what is defined in the OOB Field Mapping for the Relationship.

Glorious implementation details and the plugin download are available.

Generally speaking, it’s not restricted to N:N and would also be useful anywhere you would like to map a value over from a child form when selecting the parent. The only drawback is that the user will not see the mapped values on the form until after the initial save refresh occurs – and that can be arranged with a bit of javascript.

Image courtesy of https://www.xeromag.com/nonmonogamy.html

Leave a Reply

Your email address will not be published. Required fields are marked *