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

Validation routine in a controller
I would like to create a generic validation routine in a controller - i.e., when the Save button is clicked on a page, the validation routine executes, errors are trapped, and the cursor/focus is placed in the appropriate field on the page.
I have a general idea of how this should work, but not sure how to have the page communicate with the controller.
Thanks,
Barb R.
Here's a simplified view of how you could implement this:
First, override the object's New or Edit buttons with a Visualforce Page.
In the Visualforce page, add your controller as an extension
Use a command button on the visualforce page to "communicate" with the controller
Define your custom validation/save routine in the controller:
Thanks, Captain...I was looking more for how to set the screen focus on a field that had failed vailidation in the controller.
Barb