I need some help, I have the following trigger, however I get the following error message “Error: Compile Error: expecting a right parentheses, found 'Integer' at line 5 column 8” What I am trying to do, is just make this trigger work for this one record type.
Record type ID = '012R00000004wJv'
My trigger is
trigger ObjectNameCheckProducts on Campaign (before insert, before update) {
for(Campaign o : Trigger.New){
If(o.Campaign.RecordType == '012R00000004wJv'
Integer counter = 0;
if(o.Institutional_Products_A_G__c != null)
counter += o.Institutional_Products_A_G__c.split(';').size();
if(o.Institutional_Products_G_Z__c != null)
counter += o.Institutional_Products_G_Z__c.split(';').size();
if(o.Intermediary_Products_A_F__c != null)
counter += o.Intermediary_Products_A_F__c.split(';').size();
if(o.Intermediary_Products_G_L__c != null)
counter += o.Intermediary_Products_G_L__c.split(';').size();
if(o.Intermediary_Products_M_Z__c != null)
counter += o.Intermediary_Products_M_Z__c.split(';').size();
if(counter > 5) o.addError('Max 5 values can be selected from Product lists');
}
}