I have a Junction object called "LOCATION JUNCTION", and it has two master-detail relationships to Opportunity and Location
When I create new junction object records like
- name1 opp1 loca1
- name2 opp2 loca1
The system should throw an error like
"please select different location"
(FOR one account if opp1 is having location1 then opp2 should not take location1) (Opportunities under same account should not have same location) How should I write a trigger on this junction object. Please suggest.