That is not working. Am i missing something?Thank you!Event eve = [select id, subject, whatId, EndDate from Event where whatId =: newOpp.id];
date d = eve.EndDate;
system.debug(d);
date e = system.today();
system.debug(e);
boolean dates = d.isSameDay(e);
system.debug('Dates: ' + dates);
if(newOpp.RecordTypeId == recordTypeServices && dates == false && newOpp.StageName == 'Proposal'){
newOpp.addError('The appointment with the customer must be completed');
}
2 respuestas
Hi Christos,I see that you have put multiple debug statements in the code while running have you checked where the code is failing? let us know the issue you are facing to check further.Looking forward to your response.Thanks.