Skip to main content
Craig Munster (MSA) 님이 #Junction Object에 질문했습니다

I'm trying to create a junction object, but I'm getting an error message that doesn't make sense. I created a custom object called Projects. I also created a custom object called Project Products. The first field I created on the Project Products object was "Project", which I designated Master-Detail. I tried to create a second field, also Master-Detail, with a relationship to Products (big surprise, right?). But "Products" wasn't available in the "Related To" list. So I went back and tried making it a Lookup Relationship. But after I click "save" on the last screen, I get this error message: 

 

Cannot Create Master-Detail Relationship You cannot create a new Master-Detail relationship on an existing custom object if records already exist. You must first create a Lookup relationship, populate the lookup field with data in all records, and then change the relationship type to Master-Detail.

 

So, two things: 

1. There are no records yet for Project Products. Nothing has been created. 

2. I am TRYING to create a Lookup relationship and it won't let me. 

 

Even if I go back and change the Project field from Master-Detail to Lookup and try again, I STILL get this same message. Anyone have any ideas on what's going on? Any thoughts or advice would be appreciated. 

 

Thanks!

 

#Junction Object  #Sales Cloud

답변 8개
  1. 2021년 7월 8일 오후 5:15

    RESOLVED!

     

    I want to post here how I got it working in case anyone else runs into the same issue and stumbles across this post. 

     

    I noticed in Dinesh's screen shot that he was in SF Classic. So I went into Setup that way. I still couldn't get the Lookup relationship to work, but I did notice that for some reason, the custom object I had created for Project wasn't listed as "Deployed". (I have no idea how that happened, as the second custom object I had created, Project Product was deployed.) So anyway, I changed the setting on Project to deployed while in Classic mode, then went back into Lightning and tried creating the Lookup relationship between Project Product and Product and Voila! This time it worked!

     

    The other thing I can't figure out is if Project wasn't deployed, how was I able to create a Master-Detail relationship between Project Product and Product? That doesn't make sense to me. 

0/9000