1

I have this apex code:

@RemoteAction
 public static Sample__c sample(){
    String rhtmlBody;
    rhtmlBody = htmlBody(emailtype, FirstName, LastName); 
}



public string htmlBody(String emailtype, String FirstName, String LastName){
     //Code . . . .
}

It has an error:

Method does not exist or incorrect signature: htmlBody(String, String, String)

Any idea on how to do this?

3

you need to make your htmlBody method as static because you can call static method only from static method.

@RemoteAction
public static Sample__c sample(){
String rhtmlBody;
rhtmlBody = htmlBody(emailtype, FirstName, LastName); 
}



public static string htmlBody(String emailtype, String FirstName, String LastName){
 //Code . . . .
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.