How to show Dynamic Error Message for Entity Attribute Validation Rule?

How to show Dynamic Error Message for Entity Attribute Validation Rule?

This post is about How to show dynamic error message to user. To make it simple I’m using HR schema’s Employee & Job table and add validation rule in Employee table’s Salary Attribute. Salary must be less than or equal to as defined in Job table according to title. Here Job Title & Max Salary value will change in Error message according to Employee.

  1. Select salary Attribute on Entity Object and Add Validation using plus(+) green button.
  2. In Rule Definition tab Select

Type = Compare
Operator=Less or Equal To
Compare With =View Object Attribute
Then select MaxSalary from JobView

3. Go to Failure Handling tab and type message to Error Message block

Salary Must be less than or equal to {0} for {1} (these are token to pass value run time)

4.Then set value for token in Token Message Expression block using JobView’s accessor name.

{0} =Jobs.MaxSalary

{1} = Jobs.JobTitle

 

 

Output:-

 

 

Sample Code

About Manish Pandey

Manish is a Project Leader at Jagran Prakashan Ltd, focused on Jdeveloper Fusion Web Application(specifically Oracle ADF). He shares his knowledge through the OTN Jdev/ADF Forum. He has written more than 50 article about Oracle ADF and Jdeveloper.

Leave a Reply

Your email address will not be published. Required fields are marked *

*