How can i call public void method from Anonymous Windows in Salesforce for debugging purpose?
Like i have apex class:
public class student{
{
public void submit()
{
system.debug('This is student class');
}
}
and when i am executing this class using below syntax,
student s = new student();
system.debug(s.submit());
getting an error.
Method does not exist or incorrect signature: void debug(void) from the type System
Best Answer
Here you can see the example of calling the apex class method from anywhere
Sample Apex class
Non-Static method create an instance of class then call
Static Method You can call simply via class name
In Salesforce you can execute your test code or sample code in the anonymous window. To open an anonymous window follow these steps:
In Lighting, you can open developer console via clicking on gear icon (setting icon).