I has objects Contracts__c with fields(Start_Date__c and End__Date__c) and related obj Actor__c. When i insert new contract i trying to check does the actor already has a contract on specified dates. I tryed before insert trigger but i am stuck. That is my quer: **SELECT** id, Name, Start_Date__c, End_Date__c, Contact__r.Name **FROM** Contract__c
i dont know how to set inserted Start/End dates value to variables and compare them with all existed records.
public static void beforeContractInsert(List<Contract__c> newContracts){
Date sDate;
Date eDate;
}