You need to sign in to do that
Don't have an account?

Passing a trigger.new to an APEX method
Hi
I want to pass trigger.new to an APEX method that will perform some job but I keep getting an error:
Method does not exist or incorrect signature: MatchCandidate.findMatch(LIST<Candidate__c>)
my trigger code is:
trigger FindMatching on Candidate__c (after insert,after update) {
MatchCandidate.findMatch(trigger.new);
}
My APEX code is:
Public with sharing class MatchCandidate {
public void findMatch(List<Candidate__c> candidates){
///My code here
}
}
Can anyone help my figure out what's wrong?
Thanks
You have to create an instance of the class and use that variable to access the method.
All Answers
You have to create an instance of the class and use that variable to access the method.
Of course,how could I miss that.
Thank you
You can also just make the method static, and your original code will work...
There's a good discussion of the pros and cons here