6. Working with Arrays, Table Fields, and Collections : Table Field Operations : Column Operations : How You Can Use Hidden Columns
 
Share this page                  
How You Can Use Hidden Columns
Hidden columns are columns in a table field that are invisible to the user. They have a variety of uses, for example, as recordkeeping or status fields.
There are two ways to implement hidden columns:
Set the bias of the column(s) to FB_INVISIBLE.
You may want some table field columns to be visible to some users but not others or invisible only some of the time. For example, it might be acceptable for a supervisor to see a salary column but unacceptable for a clerk to see that information. To change a column to invisible, set the CurBias attribute of the ColumnField object to FB_INVISIBLE.
The following code in a frame's initialize section determines who is using the application and sets the CurBias attribute for the columns in the frame's table field accordingly:
select  :user_name = dbmsinfo('username'),
        :dba_name = dbmsinfo('dba');
commit;
if user_name != dba_name then
    field(custtable[*].acctbal).CurBias =
    FB_INVISIBLE;
Use this strategy only if you want to change the visibility of the column during the running of frame, since it adversely affects performance.
Define a user class that contains hidden columns and those displayed in the table field.
This is the most efficient way to implement hidden columns. This way is useful for keeping a record of data that might be changed by the user.