A Visualforce action can return a navigation result, commonly represented by a PageReference. Decide whether navigation is needed after validation and whether the destination is allowed.
Before you begin
Use an authorized development or training organization with fictional records. Record the object names, permissions and configuration used so that someone else can reproduce the exercise.
Work through the idea
First describe the business requirement and the records involved. Keep the exercise separate from a live organization's data and change process. Platform behavior can depend on permissions and configuration; verify those conditions rather than assuming an administrator's result applies to every user.
- Identify the action and destination
- Handle invalid form state first
- Keep navigation targets explicit
Practice task
Design a sample edit form that stays on validation failure and returns to a known record view on success.
Check your result
Describe both outcomes and confirm user-supplied text cannot choose an arbitrary external destination.
A mistake to avoid
Avoid trusting an unrestricted redirect URL from a request parameter.
Keep a review note
Save the inputs or scenario, your reasoning and the result you checked. Explain one assumption and one case that needs more work. Revise the exercise after feedback and distinguish what you demonstrated from what remains untested.
Official reference for further study
Explore the related learning path · Choose another worksheet
