Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Oracle Forms : Validation Triggers

5,379 views

Published on

Oracle Forms : Validation Triggers

Published in: Software
  • Be the first to comment

  • Be the first to like this

Oracle Forms : Validation Triggers

  1. 1. Validation & Navigational Triggers http://ebiztechnics.blogspot.com
  2. 2. Objectives • What is Validation Unit? • Form Builder Validation Properties • Using triggers to implement Validation • Navigation in Forms • Navigation Properties • Navigational Triggers • Built-ins used for Navigation http://ebiztechnics.blogspot.com
  3. 3. Validation in Form Builder • Form Builder provides the Validation at 4 Levels: Form Level Block Level Record Level Item Level http://ebiztechnics.blogspot.com
  4. 4. Validation • Validation occurs when: – Enter key is pressed or ENTER Built-in execute. – Operator or trigger leaves the validation unit (includes a Commit) http://ebiztechnics.blogspot.com
  5. 5. Validation Property Form Module Properties -> Database-> Validation Unit http://ebiztechnics.blogspot.com
  6. 6. Validate from list • Text item Property • Used to validate from LOV • If the input value does not exist in LOV the List of values window appears to choose. • Note: Do not use this property for large number of values. http://ebiztechnics.blogspot.com
  7. 7. Validation Triggers • Item Level – When-Validate-Item • Block Level – When-Validate-Record IF :emp.ename is null or :emp.hiredate is null THEN message(‘Employee name or Joining Date can not be blank’); RAISE form_trigger_failure; END IF; http://ebiztechnics.blogspot.com
  8. 8. Validating User Input • Salary Details Form. 7987Emp No When-Validate-Item SELECT ………. FROM emp WHERE empno=:empsal.empno; Trigger Failure http://ebiztechnics.blogspot.com
  9. 9. Validation Status • NEW – When a record is created – Also for Copy Value from Item or Initial Value • CHANGED – When changed by user or trigger – When any item in new record is changed • VALID – When validation has been successful – After records are fetched from database – After a successful post or commit – Duplicated record inherits status of source http://ebiztechnics.blogspot.com
  10. 10. Built-ins for Validation • CLEAR_BLOCK, CLEAR_ FORM, EXIT_FORM • ENTER • SET_FORM_PROPERTY – (..., VALIDATION) – (..., VALIDATION_UNIT) • ITEM_IS_VALID item property • VALIDATE (VALIDATION_ UNIT) SET_FORM_PROPERTY(‘FORM_MOD’,VALIDATION_UNIT, );ITEM_SCOPE RECORD_SCOPE / BLOCK_SCOPE / FORM_SCOPE http://ebiztechnics.blogspot.com
  11. 11. Navigation in forms • What is Navigational Unit? • Navigation in – Form – Block – Record – Item • Entering and Leaving Objects • What happens if navigation fails? http://ebiztechnics.blogspot.com
  12. 12. Navigation Properties • Form module – Mouse navigation limit – First navigation data block • Block – Navigation style – Previous navigation data block – Next navigation data block • Item – Enabled – Keyboard navigable – Mouse navigate – Previous navigation item – Next navigation item http://ebiztechnics.blogspot.com
  13. 13. Navigation in Blocks Exit item Exit record Exit block Enter block Enter record Enter item http://ebiztechnics.blogspot.com
  14. 14. Internal Navigation Exit item Exit record Enter record Enter item http://ebiztechnics.blogspot.com
  15. 15. Navigational Triggers When-New-“object”-Instance Fire after navigation Does fire when validation unit is higher than the trigger object Allow restricted and unrestricted built-ins Are not affected by failure Pre- and Post- Fire during navigation Does not fire if validation unit is higher than trigger object Allow unrestricted built-ins Handle failure by returning to initial object http://ebiztechnics.blogspot.com
  16. 16. Pre- and Post- Triggers • Pre/Post-Form • Pre/Post-Block • Pre/Post-Record • Pre/Post-Text-Item http://ebiztechnics.blogspot.com
  17. 17. Example Pre-Block Trigger IF GET_APPLICATION_PROPERTY(username)=‘SCOTT’ THEN SET_BLOCK_PROPERTY(‘EMP’,UPDATE_ALLOWED, Property_False); END IF; http://ebiztechnics.blogspot.com
  18. 18. When-New-”object” Instance • When-New-Form-Instance • When-New-Block-Instance • When-New-Record-Instance • When-New-Item-Instance http://ebiztechnics.blogspot.com
  19. 19. Examples SET_FORM_PROPERTY(‘EMPL’, VALIDATION_UNIT, RECORD_SCOPE); SET_BLOCK_PROPERTY(‘EMP’, QUERY_ALLOWED, PROPERTY_FALSE); READ_IMAGE_FILE(‘E_’||:emp.empno||’.bmp’,’BMP’, ’emp.emp_image); SET_ITEM_PROPERTY(:SYSTEM.cursor_item, visual_attribute, ‘vared’); http://ebiztechnics.blogspot.com
  20. 20. Navigational Trap Pre-Text-Item Pre-Text-Item Post-Text-Item http://ebiztechnics.blogspot.com
  21. 21. Summary • Validation Unit • Triggers and Built-ins for Validation. – When-Validate-Item and When-Validate-Record • Validation Properties • Navigation in Forms • Internal and External Navigation • Navigational Triggers – Pre- , Post- and When-New-”Object”-Instance Triggers http://ebiztechnics.blogspot.com

×