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

I am trying to run below code in developer console and calling method anonymous window in salesforce . But getting error that method signature is not found.
Public Class CommonHelper1 {
public static Void getpostionbylocation (string CityName)
{
list<Position__C> lstpos =[Select id ,name from Position__C where location__C =:CityName];
system.debug('Postion Record collection size' +lstpos.size());
if (!lstpos.isempty())
{
for(Position__C pos :lstpos)
{
system.debug('Position Record is '+pos);
}
}
}
}
calling method anonymous window :CommonHelper1.getpostionbylocation('Delhi');
public static Void getpostionbylocation (string CityName)
{
list<Position__C> lstpos =[Select id ,name from Position__C where location__C =:CityName];
system.debug('Postion Record collection size' +lstpos.size());
if (!lstpos.isempty())
{
for(Position__C pos :lstpos)
{
system.debug('Position Record is '+pos);
}
}
}
}
calling method anonymous window :CommonHelper1.getpostionbylocation('Delhi');
CommonHelper1 instance = new CommonHelper1();
instance.getpostionbylocation('Delhi');