Setting up a many-to-many relationship with Custom Objects | Community
Skip to main content
Tom_liolios2
New Participant
June 3, 2020
Solved

Setting up a many-to-many relationship with Custom Objects

  • June 3, 2020
  • 2 replies
  • 5731 views

Hi everyone,

 

We have a Salesforce instance in which all our Accounts are tagged for segmentation purposes. In Salesforce, each account has one Tag Assignment, which is related zero or more Tags. I'm assuming this constitutes a many-to-many relationship: many Accounts are related to many Tags through Tag Assignments, which serves as a 'Bridge Object'.

 

We would like to synchronize the Tags in our Salesforce instance with Marketo, either manually (Import Custom Object Data) or automatically (API). Therefore, I'm attempting to replicate the data model with Custom Objects in Marketo. Unfortunately, I can't seem to figure out what the best approach is.

 

I have taken the following steps:

  • Create a Custom Object 'Tag'
    • Create a 'Tag ID' field and set it as deduplication field
    • Create a 'Tag Name' field
  • Create a Custom Object 'Tag Assignment'
    • Create a 'Tag Assignment ID' field and set is as deduplication field
    • Create a 'Company ID' field, set is as link field and link it to the 'Company ID' field on the Company Object
    • Create a 'Tag ID' field, set it as link field and link it to the 'Tag ID' field on the Tag Object

At first glance, this approach seems to work. But when I import Custom Object Data, not all person records with the same Company ID receive a tag. It seems as if it only relates the Custom Object to the first 'Person' is sees, while it should be related to the 'Company'.

 

Does anyone have experience setting up something like this? It would be very helpful to get some additional pointers.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Michael_Florin-2

Hey Tom,

 

I don't think I said that. 🙂

https://docs.marketo.com/display/public/DOCS/Understanding+Marketo+Custom+Objects#UnderstandingMarketoCustomObjects-customcompanyUsingCustomObjectswithCompanies

Here's the passage I was referring to. It hides in this sentence:

"Custom Objects can only directly link to a single record. This means that when your custom object type is linked by company field, you should ensure that your person records are associated to a company either using contact conversion in your CRM, or using the externalCompanyId field."

So you can definitely tie a Custom Object to a Company - as seen in your screenshot. And you will see this Custom Object on the detail pages of all Contacts that Salesforce lists under that Account, same as a Smart List with the filter "Has Custom Object X" will return all these contacts.

2 replies

Michael_Florin-2
New Participant
June 3, 2020

Just  for clarity on your phrase "not all person records with the same Company ID": If you link a Custom Object to a Marketo Company Object, only Contacts are being associated with the CO. If you happen to have Leads in Salesforce that are underneath Salesforce Accounts, these would not show up.

Tom_liolios2
New Participant
June 3, 2020

Hi Michael,

 

Thanks for your response. I assumed it was possible to update the Company Object, regardless of the Person Record. But if I understand you correctly, it's only possible to update data on a Person level?

 

Thanks!

 

 

Michael_Florin-2
Michael_Florin-2Accepted solution
New Participant
June 3, 2020

Hey Tom,

 

I don't think I said that. 🙂

https://docs.marketo.com/display/public/DOCS/Understanding+Marketo+Custom+Objects#UnderstandingMarketoCustomObjects-customcompanyUsingCustomObjectswithCompanies

Here's the passage I was referring to. It hides in this sentence:

"Custom Objects can only directly link to a single record. This means that when your custom object type is linked by company field, you should ensure that your person records are associated to a company either using contact conversion in your CRM, or using the externalCompanyId field."

So you can definitely tie a Custom Object to a Company - as seen in your screenshot. And you will see this Custom Object on the detail pages of all Contacts that Salesforce lists under that Account, same as a Smart List with the filter "Has Custom Object X" will return all these contacts.

New Participant
June 3, 2020

Hi Tom,

Marketo is a bit different in that way from Salesforce it doesn't have the concept of Account object it's only lead which can be linked with the custom object. So whenever new lead comes you need to update the custom object data either using API or manually. 

Tom_liolios2
New Participant
June 3, 2020

Hi Ajay,

 

Thanks for your reply. I'm a bit confused though. Marketo suggest to link to the Company Object:

 

Company does not appear under the list of Custom Objects, so I assumed it was a standard Object. If Company is not a default Object in Marketo, what is it then? And how does it 'relate' to the Person Object?

 

Thanks for the help so far!