+ Start a Discussion
MattWMattW 

Using a Junction Object to Make Opportunity Fields Available for Roll Up Summary

I have built a custom object that I want to use to hold roll up summary data on the Opportunity Amounts that are related to it. As you cannot use Opportunity records in a Master Detail realtionship with a Custom object, I have created a Junction object with a lookup relationship to the Opportunity, and a Master Detail relationship to the Custom Object where the roll ups will happen.

Having set up all the objects and relationships, the junctions and roll ups work, but the issue I am having is with automation. I have set up Processes that create a new junction record and copy over the relevant fields from the Opportunity (at either creation, or update to closed won), but am struggling to automate the completion of the Master Detail field on the junction object that will hold the roll ups.

I have tried copying a text formula that matches the name of existing Custom Object, but keep receiving ID errors that prevent the process running. How else could I populate the Master Detail field on the junction object when it is created?

Any suggestions that could help me make this work would be gratefully accepted.

PS: I know that another option is to use Flows, or a declarative rollup solution/roll up manager, but I am trying to see if I make this approach work.
Shane OliverShane Oliver

[quote]I have built a custom object that I want to use to hold roll up summary data on the Opportunity Amounts that are related to it. As you cannot use Opportunity records in a Master Detail realtionship with a Custom object, I have created a Junction object with a lookup relationship to the Opportunity, and a Master Detail relationship to the Custom Object where the roll ups will happen.

Having set up all the objects and relationships, the junctions and roll ups work, but the issue I am having is with automation. I have set up Processes that create a new junction record and copy over the relevant fields from the Opportunity (at either creation, or update to closed won), but am struggling to automate the completion of the Master Detail field on the junction object that will hold the roll ups.

I have tried copying a text formula that matches the name of existing Custom Object, but keep receiving ID errors that prevent the process running. How else could I populate the Master Detail field on the junction object when it is created?

Any suggestions that could help me make this work would be gratefully accepted.

PS: I know that another option is to use Flows, or a declarative rollup solution/roll up manager, but I am trying to see if I make this approach work.[quote]

I also have the same question.If someone has some anwers it will be awesome if you share those.

 

Thanks in advance,

Regards
Shane.
__________________________________________________________________________________________________________________
https://freejobalert.vip/ https://gimp.software/