In Oracle Forms, SET_ITEM_PROPERTY built-in is used to set an Item property at runtime. For example, you want to make enable or disable a push button on a certain condition. Then you can use SET_ITEM_PROPERTY built-in to do that. Below I am giving some examples of SET_ITEM_PROPERTY in Oracle Forms.



SET_ITEM_PROPERTY('block.item_name', property_setting, property_value);

SET_ITEM_PROPERTY Built-in Examples

1. The following example disables a Text Item named ENAME in EMP block.

SET_ITEM_PROPERTY('emp.ename', enabled, property_false);

2. To disable a push button in Oracle Forms. Below example will disable the push button named SAVEBUTTON in CONTROL block.

SET_ITEM_PROPERTY('control.savebutton', enabled, property_false);

3. To enable push button use the following statement.

SET_ITEM_PROPERTY('control.savebutton', enabled, property_true);

4. Change the label of a push button.

SET_ITEM_PROPERTY('control.savebutton', label, 'New Label');

5. Change the prompt text of an item in Oracle Forms.

SET_ITEM_PROPERTY('emp.ename', prompt_text, 'Employee Name: ');

6. Change the width of an item. Applies to push button and text items.

SET_ITEM_PROPERTY('emp.ename', width, 200);

7. To do not allow to update a field.

SET_ITEM_PROPERTY('emp.ename', update_allowed, property_false);

8. Set the visual attribute for an item.

SET_ITEM_PROPERTY('emp.ename', visual_attribute, 'your_visual_attribute_name');

9. To set an item's font bold.

SET_ITEM_PROPERTY('emp.ename', font_weight, font_bold);

10. Set a tooltip text for a push button.

SET_ITEM_PROPERTY('control.savebutton', tooltip_text, 'Click to Save');

See also:

Related:  8 Most Required Examples Reference For Oracle Forms

Vinish Kapoor

An Oracle Apex Consultant, Oracle ACE, and founder of and a question and answer forum for developers.

This Post Has 3 Comments

  1. usman
    SET_ITEM_PROPERTY('emp.ename', prompt_text, 'Employee Name: ');
    its not working .
    1. Vinish Kapoor

      The syntax is correct, you have to check yourself why it is not working.

    2. Hany Elagaty
      set_item_property('emp.ename' ,PROMPT_TEXT ,'Employee Name: ');
      capital letters

Comments are closed.