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
Ricardo OrtegaRicardo Ortega 

junction object

Is there a simple way to avoid duplicates of a junction object? I have a contact master detail and a program master detail. If there is a very simple way using a text field please let me know. If its using the default value please give me a code example Thanks!

Marko LamotMarko Lamot

I'm afraid you will have to write apex trigger on that junction object.

souvik9086souvik9086

You can write a trigger on that junction object insert/update and check for existing records and if found duplicate present, then display errors to the user.

 

If this post is helpful please throw Kudos.If this post solves your problem kindly mark it as solution.

Thanks