You need to sign in to do that
Don't have an account?
G P 18
Non static method cannot be referenced from a static context: void EmailManager.sendMail(String, String, String)
Non static method cannot be referenced from a static context: void EmailManager.sendMail(String, String, String)
if (Trigger.isInsert) {
Integer recordCount = Trigger.New.size();
// Call a utility method from another class
EmailManager.sendMail('pgayam6@gmail.com', 'Trailhead Trigger Tutorial',
recordCount + ' contact(s) were inserted.');
}
else if (Trigger.isDelete) {
// Process after delete
}
}
and try this code also
Can you help me on this issue.
@isTest
public class testCode {
@isTest
public static void testCode(){
List<String> Countries = new List<String>();
List<String> Languages = new List<String>();
Map<String, List<String>> countryMap = new Map<String, List<String>>{
'Germany' => new List<String>{'German'},
'Spain' => new List<String>{'Spanish'},
'France' => new List<String>{'French'},
'UnitedStates' => new List<String>{'English', 'Spanish'},
'Canada' => new List<String>{'English', 'French'}};
for(String c : 'Spain'){
for(String l : 'Spanish'){
if(countrymap.containskey(c) && !Countrymap.get(c).contains(l)){
adderror( 'country ' + c + ' does not support language ' + l);
return;
}
}
}
}
}
I am aslo getting same error.
Thanks Inadvance.
P.Balaji