Validation
Objectives <ul><li>After completing this lesson, you should be able to do the following: </li></ul><ul><ul><li>Explain the...
The Validation Process <ul><li>Forms validates at the following levels: </li></ul>Form level Block level Record level Item...
The Validation Process <ul><li>Validation occurs when: </li></ul><ul><ul><li>[Enter]  key or  ENTER  Built-in is  obeyed <...
Controlling Validation Using Properties: Validation Unit
 
Controlling Validation Using Properties: Validate from List LOV TERRY Full  list MART Partial list Valid Auto complete AL ...
 
Controlling Validation Using Triggers <ul><ul><li>Item level: When-Validate-Item </li></ul></ul><ul><ul><li>Block level: W...
 
Example: Validating User Input Trigger failure? When-Validate-Item Customer ID SELECT . . . WHERE customer_id = :ORDERS.cu...
 
Using Client-Side Validation <ul><ul><li>Forms validation: </li></ul></ul><ul><ul><ul><li>Occurs on  middle tier </li></ul...
 
Using Client-Side Validation <ul><li>To use a PJC: </li></ul><ul><ul><li>1. Set the item’s Implementation Class property <...
Tracking Validation Status <ul><ul><li>NEW </li></ul></ul><ul><ul><ul><li>When a record is created </li></ul></ul></ul><ul...
 
Controlling When Validation Occurs with Built-Ins <ul><ul><li>CLEAR_BLOCK ,  CLEAR_FORM ,  EXIT_FORM </li></ul></ul><ul><u...
 
Summary <ul><li>In this lesson, you should have learned that: </li></ul><ul><ul><li>The validation unit specifies how much...
Summary <ul><ul><li>Forms tracks validation status of items and records, which are either  NEW ,  CHANGED , or  VALID . </...
Practice 19 Overview <ul><li>This practice covers the following topics: </li></ul><ul><ul><li>Validating the Sales Represe...
 
 
Upcoming SlideShare
Loading in …5
×

Les19

1,499 views

Published on

Published in: Technology, Education
  • Be the first to comment

Les19

  1. 1. Validation
  2. 2. Objectives <ul><li>After completing this lesson, you should be able to do the following: </li></ul><ul><ul><li>Explain the effects of the validation unit upon a form </li></ul></ul><ul><ul><li>Control validation: </li></ul></ul><ul><ul><ul><li>Using object properties </li></ul></ul></ul><ul><ul><ul><li>Using triggers </li></ul></ul></ul><ul><ul><ul><li>Using Pluggable Java Components </li></ul></ul></ul><ul><ul><li>Describe how Forms tracks validation status </li></ul></ul><ul><ul><li>Control when validation occurs </li></ul></ul>
  3. 3. The Validation Process <ul><li>Forms validates at the following levels: </li></ul>Form level Block level Record level Item level
  4. 4. The Validation Process <ul><li>Validation occurs when: </li></ul><ul><ul><li>[Enter] key or ENTER Built-in is obeyed </li></ul></ul><ul><ul><li>Operator or trigger leaves the validation unit (includes a Commit) </li></ul></ul>
  5. 5. Controlling Validation Using Properties: Validation Unit
  6. 7. Controlling Validation Using Properties: Validate from List LOV TERRY Full list MART Partial list Valid Auto complete AL ALAN HDATE --------------- 20-FEB-1981 22-FEB-1981 06-MAR-1996 06-FEB-1995 08-SEP-1981 ENAME --------------- MARTIN MARTINEZ SEDAT WARD ALAN WARD
  7. 9. Controlling Validation Using Triggers <ul><ul><li>Item level: When-Validate-Item </li></ul></ul><ul><ul><li>Block level: When-Validate-Record </li></ul></ul>IF :ORDERS.order_date > SYSDATE THEN MESSAGE(Order Date is later than today!’); RAISE form_trigger_failure; END IF;
  8. 11. Example: Validating User Input Trigger failure? When-Validate-Item Customer ID SELECT . . . WHERE customer_id = :ORDERS.customer_id 104
  9. 13. Using Client-Side Validation <ul><ul><li>Forms validation: </li></ul></ul><ul><ul><ul><li>Occurs on middle tier </li></ul></ul></ul><ul><ul><ul><li>Involves network traffic </li></ul></ul></ul><ul><ul><li>Client-side validation: </li></ul></ul><ul><ul><ul><li>Improves performance </li></ul></ul></ul><ul><ul><ul><li>Implemented with PJC </li></ul></ul></ul>Attempt to enter alphabetic characters Using number datatype Using KeyFilter PJC
  10. 15. Using Client-Side Validation <ul><li>To use a PJC: </li></ul><ul><ul><li>1. Set the item’s Implementation Class property </li></ul></ul><ul><ul><li>2. Set properties for the PJC </li></ul></ul>SET_CUSTOM_PROPERTY('order_items.quantity', 1,'FILTER_TYPE','NUMERIC');
  11. 16. Tracking Validation Status <ul><ul><li>NEW </li></ul></ul><ul><ul><ul><li>When a record is created </li></ul></ul></ul><ul><ul><ul><li>Also for Copy Value from Item or Initial Value </li></ul></ul></ul><ul><ul><li>CHANGED </li></ul></ul><ul><ul><ul><li>When changed by user or trigger </li></ul></ul></ul><ul><ul><ul><li>When any item in new record is changed </li></ul></ul></ul><ul><ul><li>VALID </li></ul></ul><ul><ul><ul><li>When validation has been successful </li></ul></ul></ul><ul><ul><ul><li>After records are fetched from database </li></ul></ul></ul><ul><ul><ul><li>After a successful post or commit </li></ul></ul></ul><ul><ul><ul><li>Duplicated record inherits status of source </li></ul></ul></ul>
  12. 18. Controlling When Validation Occurs with Built-Ins <ul><ul><li>CLEAR_BLOCK , CLEAR_FORM , EXIT_FORM </li></ul></ul><ul><ul><li>ENTER </li></ul></ul><ul><ul><li>SET_FORM_PROPERTY </li></ul></ul><ul><ul><ul><li>( ... , VALIDATION ) </li></ul></ul></ul><ul><ul><ul><li>( ... , VALIDATION_UNIT ) </li></ul></ul></ul><ul><ul><li>ITEM_IS_VALID item property </li></ul></ul><ul><ul><li>VALIDATE ( scope ) </li></ul></ul>
  13. 20. Summary <ul><li>In this lesson, you should have learned that: </li></ul><ul><ul><li>The validation unit specifies how much data is entered before validation occurs. </li></ul></ul><ul><ul><li>You can control validation using: </li></ul></ul><ul><ul><ul><li>Object properties: Validation Unit (form); Validate from List (item) </li></ul></ul></ul><ul><ul><ul><li>Triggers: When-Validate-Item (item level); When-Validate-Record (block level) </li></ul></ul></ul><ul><ul><ul><li>Pluggable Java Components for client-side validation </li></ul></ul></ul>
  14. 21. Summary <ul><ul><li>Forms tracks validation status of items and records, which are either NEW , CHANGED , or VALID . </li></ul></ul><ul><ul><li>You can use built-ins to control when validation occurs: </li></ul></ul><ul><ul><ul><li>CLEAR_BLOCK </li></ul></ul></ul><ul><ul><ul><li>CLEAR_FORM </li></ul></ul></ul><ul><ul><ul><li>EXIT_FORM </li></ul></ul></ul><ul><ul><ul><li>ENTER </li></ul></ul></ul><ul><ul><ul><li>ITEM_IS_VALID </li></ul></ul></ul><ul><ul><ul><li>VALIDATE </li></ul></ul></ul>
  15. 22. Practice 19 Overview <ul><li>This practice covers the following topics: </li></ul><ul><ul><li>Validating the Sales Representative item value by using an LOV </li></ul></ul><ul><ul><li>Writing a validation trigger to check that online orders are CREDIT orders </li></ul></ul><ul><ul><li>Populating customer names, sales representative names, and IDs when a customer ID is changed </li></ul></ul><ul><ul><li>Writing a validation trigger to populate the name and the price of the product when the product ID is changed </li></ul></ul><ul><ul><li>Restricting user input to numeric characters using a Pluggable Java Component </li></ul></ul>

×