11.01.2013 Views

Oracle Forms Developer – Form Builder Reference, Volume 1

Oracle Forms Developer – Form Builder Reference, Volume 1

Oracle Forms Developer – Form Builder Reference, Volume 1

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

On-Column-Security trigger<br />

Description<br />

Fires when <strong>Form</strong> <strong>Builder</strong> would normally enforce column-level security for each block that has the<br />

Enforce Column Security block property set On.<br />

By default, <strong>Form</strong> <strong>Builder</strong> enforces column security by querying the database to determine the base table<br />

columns to which the current form operator has update privileges. For columns to which the operator<br />

does not have update privileges, <strong>Form</strong> <strong>Builder</strong> makes the corresponding base table items in the form nonupdateable<br />

by setting the Update Allowed item property Off dynamically. <strong>Form</strong> <strong>Builder</strong> performs this<br />

operation at form startup, processing each block in sequence.<br />

Definition Level form, block<br />

Legal Commands<br />

SELECT statements, PL/SQL, unrestricted built-ins<br />

Enter Query Mode no<br />

Usage Notes<br />

To perform the default processing from this trigger, call the ENFORCE_COLUMN_SECURITY builtin.<br />

On Failure<br />

no effect<br />

On-Column-Security trigger examples<br />

Example<br />

The following example sets salary and commission text items in the current block to disabled and nonupdateable,<br />

unless the SUPERUSER role is enabled. Only users with the user-defined SUPERUSER role<br />

can change these number fields.<br />

DECLARE<br />

itm_id Item;<br />

on_or_off NUMBER;<br />

BEGIN<br />

IF NOT role_is_set(’SUPERUSER’) THEN<br />

on_or_off := PROPERTY_OFF;<br />

ELSE<br />

on_or_off := PROPERTY_ON;<br />

END IF;<br />

itm_id := Find_Item(’Emp.Sal’);<br />

Set_Item_Property(itm_id,ENABLED,on_or_off);<br />

Set_Item_Property(itm_id,UPDATEABLE,on_or_off);<br />

itm_id := Find_Item(’Emp.Comm’);<br />

Set_Item_Property(itm_id,ENABLED,on_or_off);<br />

Set_Item_Property(itm_id,UPDATEABLE,on_or_off);<br />

438<br />

IF form_fatal OR form_failure THEN

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!