You need to sign in to do that
Don't have an account?
pfep
help on this trigger
Error: Compile Error: AND operator can only be applied to Boolean expressions at line 15 column 40 |
this is what it say all the time. how can it b fixed?
trigger PreventEngagementsFromDelete on Engagement__c(before Delete){
RecordType[] RT = [Select Name From RecordType Where sObjectType = 'engagement__c' and Name = 'Interest Form' and isActive = true LIMIT 1];
for(Engagement__c e : trigger.new){
if(!rt.isEmpty()){
if(e.RecordTypeID = RT[0].id && e.Status__c = 'Prospect')
e.addError('You cannot delete this record');
}else{
e.addError('Contact System Admin, there was an error finding the correct RecordType for this validation');
}
}
Change the Line as below
if(e.RecordTypeID == RT[0].id && e.Status__c == 'Prospect')
Please mark as solved if this helps.