user19222992
user19222992

Reputation: 3

How to make a button conditional in Oracle Forms

I am very new to oracle forms and I have to make a button conditional on my form.

The visibility of the button depends on user role.

The button should be visible only to a user whose role is 'admin'. If the role is 'super admin' the button should not be visible.

Thanks!

Upvotes: 0

Views: 365

Answers (1)

Littlefoot
Littlefoot

Reputation: 142743

Use the set_item_property built-in and its displayed property.

You didn't explain how to know who is who, so I'll guess that it is contained in a global variable, so you'd then

if :global.user_role = 'super_admin' then
   set_item_property ('employees.btn_create_department', displayed, property_false);
elsif :global.user_role = 'admin' then
   set_item_property ('employees.btn_create_department', displayed, property_true);
end if;

For more info, open Forms Online Help system and read about that procedure.

Upvotes: 1

Related Questions