You need to sign in to do that
Don't have an account?
manojjain4328
How can i pass optional/default parameter in apex mathod?
| |||
03-19-2010 04:21 PM |
First of all... PLEASE SEARCH BEFORE POSTING (I found the answer within two seconds of doing so)
You can't using optional and default values in functions but you can use overloading.
eg.
public void foo(String xyz) { system.debug(xyz); } public void foo() { foo('FOOBAR'); } foo();
The above will print FOOBAR to the debug log.
If you still dont understand, google it.
All Answers
First of all... PLEASE SEARCH BEFORE POSTING (I found the answer within two seconds of doing so)
You can't using optional and default values in functions but you can use overloading.
eg.
public void foo(String xyz) { system.debug(xyz); } public void foo() { foo('FOOBAR'); } foo();
The above will print FOOBAR to the debug log.
If you still dont understand, google it.