Field Level Validation in Oracle ADF

Perform Field Level Validation in Oracle ADF

We can also define the field level validation at Entity Object Level. The purpose of validation is to validate data before sent to the database. Declarative validation involves following steps:-

1) Add validation
2) Define Validation
3) Set Error Message

In this post we will continue the previous post example and perform validation on Salary Field.

Open the employee entity from model.eo package. From attribute select Salary field, open the Validation Rule tab and click plus sign to Add the Validation.

Select the Compare as Rule Type. From the Rule Definition choose GreaterThan operator and compare with Literal Value. Enter Literal Value to 0.

To set the error message open Failure Handling tab. Choose Error as Validation Failure Severity. Enter the Error Message in Message Text box.

Finally run the AppModule from model.vo package. Open the EmployeeView1, enter -1 in Employee Salary Field and than leave the filed. You will prompt the same validation message as we defined above.


About Oracle Technology Blogs
Oracle Application Development

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: