+ Start a Discussion
HarryHHHarryHH 

compilation error because public method not found

Hallo,

 

I have a public class called parameterlesenclass in which I have a public function called read_decimal_param like this:

 

public class Parameterlesenclass

{

...

    public decimal read_decimal_param (String param_name)

    {

    ...

    }

}

 

If I now try to call this function from a clobal void within a global class with the following code:

 

        Decimal WBZ = parameterlesenclass.read_decimal_param('WBZ');

 

I get the compilation error:  Method does not exist or incorrect signature: parameterlesenclass.read_decimal_param(String)

 

Has anyone an idea why a public function is not found?

 

Thanks Harry

Best Answer chosen by Admin (Salesforce Developers) 
Imran MohammedImran Mohammed

You have to declare the method either as static or create an instance of the class and then access the method.

All Answers

Imran MohammedImran Mohammed

You have to declare the method either as static or create an instance of the class and then access the method.

This was selected as the best answer
HarryHHHarryHH

That was a silly question!

Thanks Harry