You need to sign in to do that
Don't have an account?

Overlap Trigger for related list.
I have a related list on the account object called Broker_Commission_Code__c. I want to ensure that broker commission codes do not overlap. I need a trigger that will check for that specific account what broker code records exist and what their effective_date__c and termination_date__c. An example would be record 1 effective date = 1/1/16 and term date = 1/31/2016 Record 2 Effective date= 1/1/2016. I would need the trigger to stop from the second record being created with that date. The earliest the second record could exist is 2/1/2016.
Thanks!
Thanks!
Oh, i forgot ot add the check for acccountId. Replace if(broker.effective_date__c == br.effective_date__c) with if(broker.effective_date__c == br.effective_date__c && broker.accountId == br.accountId). Do the same for termination date please