MinnPost / object-sync-for-salesforce

WordPress plugin that maps and syncs data between Salesforce objects and WordPress objects.
https://wordpress.org/plugins/object-sync-for-salesforce/
GNU General Public License v2.0
94 stars 51 forks source link

Multiple fieldmaps for a WordPress object based on the Salesforce Record Type #394

Open jonathanstegall opened 3 years ago

jonathanstegall commented 3 years ago

Is your feature request related to a problem? Please describe. See this forum post.

So we have a setup where there is 1 WordPress Post Type that has a field that indicates a Type. This is mapped to a Salesforce object that has 3 different record types. I need to be able to dictate to the sync process which of the 3 field mappings should be used based on this Type field in WordPress. What I see happening is that since a since WordPress Post Type has 3 different Salesforce mappings, due to this Object Type field in Salesforce, it’s running a Create based on the first field mapping in the list instead of the correct one based on the WordPress type field.

Describe the solution you'd like Maybe the code that loads the fieldmap could check to see if there's a Salesforce record type specified on the fieldmap.

This might be complicated, since there are multiple record types allowed for many Salesforce object types. I'm not sure it's doable in a visual way. But it's worth thinking about.

jose-dvm commented 6 months ago

Setting different mappings for the same WP object would be great. In the Drupal plugin, for example, different mappings can be used for different webform submissions based on Entity Bundle if I'm not wrong.