Pages

Sunday, May 23, 2010

Step 11 – Apex Developer Day - Adding an Item Validation

You don't want a user entering a date prior to today's date. This type of check can be done through an item validation. Perform the following steps:

1.

Click the Create (clip_image002) icon in the Validations section for Page 5.

clip_image004

2.

Accept the default to create an Item level validation and click Next >.

clip_image006

3.

Select the item P5_PROJECT_DEADLINE and click Next >.

clip_image008

4.

Select SQL for the Validation Method and click Next >.

clip_image010

5.

Because you want to specify the condition when a PROJECT_DEADLINE is incorrect, click SQL Expression and click Next >.

clip_image012

6.

Enter P5_PROJECT_DEADLINE as Validation Name and click Next >.

clip_image014

7.

Enter TO_DATE(:P5_PROJECT_DEADLINE,'MM/DD/YYYY') >= SYSDATE for the Validation and Date needs to be greater than today for the Error Message and click Next >.

clip_image016

8.

Select Request Is Contained within Expression1 for the Condition Type and enter SAVE,CREATE for Expression1. Then click Create.

clip_image018

9.

The validation has been created successfully. Click Run.

clip_image020

10.

Change the date to something prior to today's date and click Apply Changes.

clip_image022

We have changed to 05/19/2004 and Apply Changes

clip_image024

11.

Notice that you receive an item (or field) error message as well as a page notification message. This is because you specified that you wanted both when you created the validation.

clip_image026

12.

Click the Application <n> link in the developer tool bar.

clip_image028

No comments:

Post a Comment