function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
KenAllredKenAllred 

Allow creation or selection of new records for objects connected with junction object

I've created a junction object called "OCP"

On object "OCP" I've created two Master-detail relationships, one that points to my custom object "Company Products" and one that points to the standard object "Opportunity". My custom object "Company Products" also has a Master-detail relationship with the standard object "Accounts".

"Company Products" <---Master-detail---- "OCP" ----Master-detail---> "Opportunity"

My sales reps need to be able to create or select "Company Products" records from the Accounts page layout (which I'm doing with standard functionality due to the master-detail relationship Company Products has with Accounts) and from the Opportunity page layout (this is where I need help).

Currently when I add the Company Products related list to the Opportunity page layout I can add all of the fields, but the "New" button is trying to create a New Junction Object record and I need this button to allow our reps to create new, or select existing Company Products records for an Opportunity.

I'm sure I do this by creating a custom button, however the custom button stuff that I have read really does my head in (I'm still a fairly new SFDC admin and am in the early parts of the learning curve).

Could someone explicitly walk me through what I need to do here? I've done extensive google searching to try to find an example, but I couldn't find anything directly applicable to what I'm trying to do (my google skills failed me!).

Thank you!

Sonam_SFDCSonam_SFDC

Hi Ken,

 

When i read the description, I understand that there is no relationship between the custom Object "Company Products" and Standard Object" Opportunity.

 

Ideally you should be able to add OCP related list to the Opportunity page and NOT Company Product as you stated :

"Currently when I add the Company Products related list to the Opportunity page layout I can add all of the fields, but the "New" button is trying to create a New Junction Object record"

 

PLease check to see if this is the OCP object related list which is the reason you are able to create junction object records.

 

I would suggest you to create a lookup relationship between Opportunity and Company Products Object so that you can add the "company porduct" related list to the Opportunity detail page.

 

Hoping I have understood the issue correctly and the info helps!