Validation Handler not showing prop.error content

Document ID : KB000109893
Last Modified Date : 07/08/2018
Show Technical Document Details
Issue:
When submitting task from Identity Portal, in spite of code inside the Validation Handler, Identity Portal is not showing the exact text from prop.error, but rather gives a default "Validation Error" text.

We are using prop.error as per example from the Identity Portal Documentation.
Resolution:
It exist within the CA Identity Portal Guide an incorrect statement regarding custom message in "Form Handler Examples"
(https://docops.ca.com/ca-identity-suite/14-1/EN/administrating/administrating-ca-identity-portal/ca-identity-portal-administration/backend/create-forms)

Where the Validate Handler example refers to :

prop.error = "Invalid object name: " + prop.value;

However error messages are handled within an array through prop.errors as documented within the Hotel Reservation Form Example
(https://docops.ca.com/ca-identity-suite/14-1/EN/programming/ca-identity-portal-developer-guide/form-handlers/hotel-reservation-form-example)

prop.errors = [result.returnValue];

So custom message can be set with :

prop.errors.push("Here is custom error message from Validate Handler"); 
or
prop.errors = ['Here is custom error message from Validate Handler'];