I have written a Visualforce page to contain a button.
<apex:commandButton action="{!resendEmailsToPatients({!Disease__c.Id})}" value="Resend Email" style Class="options"/>
In my Visualforce page controller, I have:
public void resendEmails (Disease__c dis) {
Disease__c d = dis;
Handler.sendPatientNotification(dis);
}
So the above calls a method "sendPatientNotification(dis)" in class "Handler". This seems ok to me.
The code in my Handler is very big, but the method looks something like:
public with sharing class Handler {
public void sendPatientNotification(Disease__c dis) {
[some code]
}
}
Now I get the following error message:
Save error: Method does not exist or incorrect signature: Handler.sendPatientNotification(SOBJECT:Disease__c)
I don't understand what I am doing wrong, because my method does exist and the signature doesn't seem to be incorrect either.
EDIT: When changing my code to call a static method on the Handler, I am still receiving the following error: Syntax Error
when attempting to save my Visualforce page.