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 : Coding ..

853 views

Published on

Oracle Forms Coding

Published in: Software
  • Be the first to comment

  • Be the first to like this

Oracle Forms : Coding ..

  1. 1. Flexible Coding in Forms http://ebiztechnics.blogspot.com
  2. 2. Objectives • Explain Flexible Coding • Advantages of using system variables • Identify built-in subprograms that assist flexible coding • Write code to reference objects by internal ID http://ebiztechnics.blogspot.com
  3. 3. Flexible Coding • What do you mean by Flexible Coding? • Is generic code • Is reusable • Avoid hard coded object names • Make maintenance easier • Increases Productivity http://ebiztechnics.blogspot.com
  4. 4. System Variables • Input focus: – SYSTEM.CURSOR_BLOCK – SYSTEM.CURSOR_RECORD – SYSTEM.CURSOR_ITEM – SYSTEM.CURSOR_VALUE http://ebiztechnics.blogspot.com
  5. 5. System Variables • Trigger focus: – SYSTEM.TRIGGER_BLOCK – SYSTEM.TRIGGER_RECORD – SYSTEM.TRIGGER_ITEM Note: prefix colon (:) before these variables Example: :SYSTEM.CURSOR_ITEM http://ebiztechnics.blogspot.com
  6. 6. Examples • IF :SYSTEM.CURSOR_BLOCK=‘DEPT’ THEN GO_BLOCK(‘EMP’); ELSIF :SYSTEM.CURSOR_BLOCK=‘EMP’ THEN GO_BLOCK(‘SALGRADE’); ELSIF :SYSTEM.CURSOR_BLOCK=‘SALGRADE’ THEN GO_BLOCK(‘DEPT’); END IF; http://ebiztechnics.blogspot.com
  7. 7. GET_”object”_PROPERTY Built-ins • GET_APPLICATION_PROPERTY • GET_FORM_PROPERTY • GET_BLOCK_PROPERTY • GET_RELATION_PROPERTY • GET_RECORD_PROPERTY • GET_ITEM_PROPERTY • GET_ITEM_INSTANCE_PROPERTY • GET_LOV_PROPERTY • GET_RADIO_BUTTON_PROPERTY • GET_MENU_ITEM_PROPERTY • GET_CANVAS_PROPERTY • GET_TAB_PAGE_PROPERTY • GET_VIEW_PROPERTY • GET_WINDOW_PROPERTY http://ebiztechnics.blogspot.com
  8. 8. SET_”object”_PROPERTY Built-ins • SET_APPLICATION_PROPERTY • SET_FORM_PROPERTY • SET_BLOCK_PROPERTY • SET_RELATION_PROPERTY • SET_RECORD_PROPERTY • SET_ITEM_PROPERTY • SET_ITEM_INSTANCE_PROPERTY • SET_LOV_PROPERTY • SET_RADIO_BUTTON_PROPERTY • SET_MENU_ITEM_PROPERTY • SET_CANVAS_PROPERTY • SET_TAB_PAGE_PROPERTY • SET_VIEW_PROPERTY • SET_WINDOW_PROPERTY http://ebiztechnics.blogspot.com
  9. 9. Object ID Finding and Object ID: Alt_id := FIND_ALERT(’Del_alert’) Referencing an Object by ID: ...SHOW_ALERT(Alt_id) Referencing and Object by Name: ...SHOW_ALERT(‘Del_alert’) http://ebiztechnics.blogspot.com
  10. 10. FIND_ Built-ins • FIND_FORM FORMMODULE • FIND_BLOCK BLOCK • FIND_ITEM ITEM • FIND_RELATION RELATION • FIND_LOV LOV • FIND_WINDOW WINDOW • FIND_VIEW VIEW • FIND_CANVAS CANVAS • FIND_ALERT ALERT • FIND_EDITOR EDITOR http://ebiztechnics.blogspot.com
  11. 11. Using Object IDs • Declare a PL/SQL variable of the same data type. • Use the variable for any later reference to the object. • Use the variable within the current PL/SQL block only. http://ebiztechnics.blogspot.com
  12. 12. Example DECLARE item_var item; BEGIN item_var := FIND_ITEM(:SYSTEM.CURSOR_ITEM); SET_ITEM_PROPERTY(item_var, visual_attribute, ‘va_blue’); END; http://ebiztechnics.blogspot.com
  13. 13. Using Object IDs • A PL/SQL variable has limited scope. • An .id extension: – Broadens the scope – Converts to a numeric format – Enables assignment to a global variable – Converts back to the object data type http://ebiztechnics.blogspot.com
  14. 14. Summary • User System Variables – To avoid hard coded object names – Make maintenance easier • Use GET_”object”_PROPERTY Built-ins to get and SET_”object”_PROPERTY Built-ins to Set the object properties at run time. • Use FIND_”object” functions to find the internal Object Ids. http://ebiztechnics.blogspot.com

×