Monday, August 09, 2010

Add Default to Tabular Form in APEX

If you want to set a default value for a column in your tabular form, you can set the Default Type to "PL/SQL Expression or Function" and put into Default e.g. 'N'.


That sets the default for that column to the static text 'N'.

12 comments:

Anonymous said...

How about if I would like to set default value from say P10_Identified_FK which the column type is number

Anonymous said...

I have the same question as previous. I cannot get default to read value from either page or app item. I've tried : and &. syntax.

Dimitri Gielis said...

try v('ITEM')

Vichu said...

or simply the item name. No need to use : or &item.

Anonymous said...

Hi, I have a problem in setting the default value for a date column in tabular form: I'd like it to be the value of a "Date Picker" item I have in the page but I get the error:"Errore report:
ORA-01790: expression must have same datatype as corresponding expression", could you help me?

Dimitri Gielis said...

what did you use as default value?

You can use:
- SYSDATE
or
- TO_DATE('01-JAN-2012','DD-MON-YYYY')

Make sure your Default Type is set to PL/SQL Expression or Function.

Yogesh said...

I would like to update SYSDATE in database using tabular form column. For that i put SYSDATE in default field of Tabular form attributes, but no data gets inserted in database.

Dimitri Gielis said...

are you sure the default type is set to pl/sql expression?

you could also try to do to_char(sysdate, 'DD-MON-YYYY') where DD-MON-YYYY is the format mask of the field

Anonymous said...

Is there any way that I can define in APEX 5.0.2.00.07 that I want to adopt the default values for items derived from columns of the underlying tables as defined in my database? I would like to believe that this would qualify to be the standard setting, but I experience it is not. Any help would be appreciated.

Kind regards,


Victor Bax
Leiderdorp, the Netherlands

Dimitri Gielis said...

You can define the same default in APEX as what you have in your database.
If you leave it blank, the default of the database will be used, but you only see it in APEX when you submitted the page (saved the record).

Md. Firoz Mahmud - Bangladesh said...

I am working a lab pathology system.
but i have faced a problem in tabular forms.
I have a database field in tabular region 'collect_by' its number field (HIDDEN SAVESTATE).
when a lab technician collect a sample by conformation check box
after save 'collect_by' field automatically entry login user id by global item like :G_USER_ID
Please help me....

Dimitri Gielis said...

Hello, checkboxes that are not submitted are not passed to the server. I guess that that is your issue.
So you would need to do a loop in a loop for the checkboxes.