This content has been marked as final. Show 3 replies
I don't know what you mean by computation did not work. You need to create a Page Computation which fires after Page Submit and that will have computed value and should use SQL process to update the field with computed column value.
There are many ways to achieve this but the above solution is straight forward and should work.
but by this way, i can only know the total after insert/update in the database, right ?
what should i do if i'd like to know the value of the compute field as soon as i leave the focus of the input fields or on click on a button called "compute CTP" for example ?
if there's no way to do that, your solution will be OK too.
Edited by: user469717 on Apr 22, 2013 4:55 AM
I've tried 2 solutions. The first one, with calculations performed by trigger, works well but i can't see the total before inserting into DB.
The second is what i prefer but impossible to get it work.
So if someone has an idea, please help
in my pdetail_modele page_
- 2 input fields P28_X and P28_Y
- 1 compute field P28_CTP
- a button "compute CTP" which has to display, for example, the sum of P28_X and P28_Y in the P28_CTP field.
Here is what i did
- process (before regions) create_mod_collection:
if apex_collection.collection_exists(p_collection_name=>'MODELE') = false then
for x in (select n001, n002 from apex_collections where collection_name='MODELE')
:P28_X := x.n001;
:P28_Y := x.n002;
- P28_X and P28_Y : nothing in source field
- P28_CTP source value or expression : select nvl(:P28_X,0) + nvl(:P28_Y,0) from dual;
- Button Compute_CTP action : redirect to page in this application with p_detail_modele in page field.
- process (after regions) add_modele_collection :
apex_collection.add_member(p_collection_name=> 'MODELE', p_n001=>:P28_X, p_n002=>:P28_Y);
Edited by: user469717 on Apr 23, 2013 11:33 AM