View link to dynamic wizard step with validation error
About this task
In Inland Marine, if page-level validation fails on a step dynamically generated by a Wizard Step Iterator, the error message links to that step. However, because you cannot navigate away from the step until you fix the error, you cannot verify that the link to the step works.
These steps create an unrealistic example that you can use to verify that the link from the error jumps to the invalid step. The example validates that a sign cannot have a description that matches the name of the primary insured. You can trigger the page validation when you quote.
Procedure
-
In IMSignPartValidation.gs, add a method
that validates that the sign description does not match the name of the primary
insured.
private function signDescriptionNotPNIName() : void { Context.addToVisited(this, "signDescriptionNotPNIName") for(sign in _signPart.IMSigns) { if ((sign.Description != null) and (sign.Description.equalsIgnoreCase(sign.Branch.PrimaryInsuredName))) { Result.addError(_signPart, ValidationLevel.TC_DEFAULT, "Sign cannot have a description of Primary Insured Name: " + sign.Branch.PrimaryInsuredName, "impartstep") } } } -
In the validateImpl method, add a call to the
signDescriptionNotPNIName method.
override protected function validateImpl() { Context.addToVisited( this, "validateImpl" ) atleastOneSign() signsMustBeUnique() signDescriptionNotPNIName() } - Compile PolicyCenter and start the server.
- Create an Inland Marine policy.
- Advance to the Signs step.
- Add a sign with description containing a name, such as "Bill Smith".
- Go back to the Policy Info screen and change the name of the Primary Named Insured to "Bill Smith".
-
Click Quote to trigger validation.
In Validation Results, PolicyCenter displays a message that there are errors on the Signs page.
- Click the error to jump to the Signs page.
