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
Esther PEsther P 

Apex code -- Standard object as junction object

Hello everyone,

Can you set a standard object as a junction object using Apex code? 

I do understand that this is not possible to achieve this through Point and Click, also there are hidden standard objects(not available on the UI) that are junction objects viz. AccountContactRole.

Thanks in advance.
Yes you can achieve a similar functionality using lookup fields on standard objects, provided you have to customize each every feature of junctions objects such as  a child record needs to be deleted if a parent record is deleted in a many to many relationship, also on the junction object you need to make both the lookups mandatory.