SOLVED

Re: One custom object to many leads relationship

Go to solution
Andrey_Tarashev
Level 2

One custom object to many leads relationship

In our CRM we have a one-to-many relationship which we want to represent in Marketo (e.g. a contact category, where each contact relates to single category).

For that purpose we create a Custom Lead Field "CategoryID" and a Custom Object "Category" which linked to a Lead's "CategoryID" field and used as dedup field for a Category object.

We expected that when we create Category object with some ID that shared among leads, all of that leads will be linked to same custom object and share same data.

But in reality only a one of leads (possibly first/last created) linked to Category, all other have no custom object of Category type.

Is it bug, or we doing something wrong? We wasn't find any restrictions or workarounds in documentation.

How do you implements one-to-many relationship in Marketo?

1 ACCEPTED SOLUTION

Accepted Solutions
Grégoire_Miche2
Level 10

Re: One custom object to many leads relationship

Hi Andrey,

What you want to do is to have the lead having a lookup field towards a custom object. The field would be the category ID and the custom object would be the list of potential categories, each lead pointing to one and only one category, but many leads being able to have the same category.

But in fact one cannot create a strict one-to-many lead-custom object relationship in Marketo. In other term, one cannot have a field in the lead table that is a lookup to a custom object.

Consider Marketo database more as a start schema with the lead table at the center than a true relational DB.

The workaround is to create a N-N relationship and limits it usage in one way. N-N relatioships are created with 2 tables: one is the target table and another one is the join table that has fields looking up to both the lead and the target table. Then, in this join table, you can make it  1-n relationship through making the lookup field to the lead table a unique.

-Greg

View solution in original post

7 REPLIES 7
SanfordWhiteman
Level 10 - Community Moderator

Re: One custom object to many leads relationship

Please move the thread to Products and someone will answer it there. "Community" is for website feedback -- and yes, this is confusing!

Andrey_Tarashev
Level 2

Re: One custom object to many leads relationship

Thank you. I hope that transferring question to a right place will help, because support still can't reply any useful information.

Grégoire_Miche2
Level 10

Re: One custom object to many leads relationship

Hi Andrey,

What you want to do is to have the lead having a lookup field towards a custom object. The field would be the category ID and the custom object would be the list of potential categories, each lead pointing to one and only one category, but many leads being able to have the same category.

But in fact one cannot create a strict one-to-many lead-custom object relationship in Marketo. In other term, one cannot have a field in the lead table that is a lookup to a custom object.

Consider Marketo database more as a start schema with the lead table at the center than a true relational DB.

The workaround is to create a N-N relationship and limits it usage in one way. N-N relatioships are created with 2 tables: one is the target table and another one is the join table that has fields looking up to both the lead and the target table. Then, in this join table, you can make it  1-n relationship through making the lookup field to the lead table a unique.

-Greg

Andrey_Tarashev
Level 2

Re: One custom object to many leads relationship

You mean that the only way is to create new custom object per lead and keep it's in sync?

I.e. when I want to change custom object's state I have to search all custom objects with "Category ID" and then update all of them instead of single one?

It looks really not cool, because can lead to data inconsistency.

Can you explain your workaround more closely? Are you suggest a maintaining relationship on our CRM side?

Grégoire_Miche2
Level 10

Re: One custom object to many leads relationship

Hi Andrey,

No, this is not what I wrote

The workaround I suggest is made of 2 custom objects, one to store the category and another one to link the lead to the category. If you want to change the category name, you just change it once in the category object.

BTW, why would you need to have a custom object to store a simple category name? Do you have other attributes that come with it? Otherwise, a simple field in the lead object should be sufficient.

-Greg

Andrey_Tarashev
Level 2

Re: One custom object to many leads relationship

Sounds interesting to link an objects via objects, will try to implement it.

However "category" was just simple example of use-case which require one-many relationship. In our case we required to store customer's information in such custom object and one customer can have a lot of leads. And we can not use "Company" objects for that purpose.


Thank you for help.

Grégoire_Miche2
Level 10

Re: One custom object to many leads relationship

Hi again Andrey,

This makes more sense

-Greg