Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to exit an apex function?

I have an apex function which has a void return type. I want to exit the function at a specific position. Is this possible in apex without changing return type pagereference?

like image 784
Yogini Mane Avatar asked Feb 13 '13 06:02

Yogini Mane


1 Answers

In apex, the return keyword signals to immediately stop processing statements in that function.

public void doNothing() {
     return;
}
like image 132
Eric Sexton Avatar answered Oct 25 '22 01:10

Eric Sexton