General discussion

Locked

oracle form problem

By pao_lupini ·
hi,

i've form in tabular format. my problem is on the basamt text item if on the next row
the iexcod is ROOM the value of BASAMT ( 300 ) on previous record which is the iexcod is ROOM.
the 300 will be deducted to a variable basic_amount equals to 500 therefore on the third row
the basamt equals to 200...


basamt is a calculated field.


layout :

IEXCOD EXPCODE DAYS ACTEXP BASAMT

ROOM NURSE 1 50000 300
MISC MISCD 1 50000 400
ROOM SURG 1 50000 200 <<<--- 3rd row desired output


thanks,
danny

This conversation is currently closed to new comments.

7 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

by Gary_W In reply to oracle form problem

If I understand you correctly, you can utilize the post-query trigger on the block. This fires for each row retrieved. Create an item that holds the previous IEXCOD so when a new record is read, you can compare and make your calculation as necessary.

Gary

Collapse -

by pao_lupini In reply to

from what i understand post-query fire only once. i'm doing the data entry at runtime. your idea of an item that will hold the iexcod could be of help but how would i do that at runtime.

Collapse -

by Gary_W In reply to oracle form problem

From the help screen:
Description

When a query is open in the block, the Post-Query trigger fires each time Form Builder fetches a record into a block. The trigger fires once for each record placed on the block's list of records.
Definition Level form or block

Collapse -

by pao_lupini In reply to

hi,
the script i place in the post-query didn't fire after entering data. how do i check for a double entry at runtime so that i could do the calculations. i hope this clarify things up.

Collapse -

by Gary_W In reply to oracle form problem

Oh! I now realize you want to do the calculation as you are entering data. Check out the when-validate-record trigger on the block, or perhaps a when-validate-item trigger on an item. These fire when leaving the record or when leaving an item.

So,
When leaving a record (when-validate-record) save the IEXCOD in the compare area. After entering the new row's base amt (when-validate-item) do your calculation.

Gary

Collapse -

by pao_lupini In reply to

hi,

I think i would have a hard time solving this via rumtime. I was thinking that
during the data entry at first there will be no calculation basamt would be set to any amt
see figure (a). then after saving i will port it to a temporary table then i'll run an update
script to correct the figures. My problem is how would i do the calculations.
let's say i have limit for 'ROOM' which is the basic amount equals to 600.
this basic amount of the same iexcod should be depreciated accordingly see figure (b) for simulation.
thank you for your time.


figure (a)
iexcod basamt
ROOM 200 <<<--- this is the allowable amount for basamt which was pre-computed
if you would notice there is an amount 200 for iexcod ROOM which
shouldn't be the case my problem here is the amount 200 should be
deducted to 600 and so on see figure (b) for the simulation
SURG 300
ROOM 200
ROOM 200
ROOM 200

thanks,
danny


figure (b)
iexcod basamt
ROOM 200
SURG 300
ROOM 400 <<<-- 600 less 200 .. wherein 600 is base on the basic amount limit as stated above
ROOM 200 <<<-- 400 less 200 .. wherein 200 is the allowable amount
ROOM 0 <<<-- 200 less 200 .. wherein 200 is the allowable amount

Collapse -

by pao_lupini In reply to oracle form problem

hi,

I think i would have a hard time solving this via rumtime. I was thinking that
during the data entry at first there will be no calculation basamt would be set to any amt
see figure (a). then after saving i will port it to a temporary table then i'll run an update
script to correct the figures. My problem is how would i do the calculations.
let's say i have limit for 'ROOM' which is the basic amount equals to 600.
this basic amount of the same iexcod should be depreciated accordingly see figure (b) for simulation.
thank you for your time.


figure (a)
iexcod basamt
ROOM 200 <<<--- this is the allowable amount for basamt which was pre-computed
if you would notice there is an amount 200 for iexcod ROOM which
shouldn't be the case my problem here is the amount 200 should be
deducted to 600 and so on see figure (b) for the simulation
SURG 300
ROOM 200
ROOM 200
ROOM 200

thanks,
danny


figure (b)
iexcod basamt
ROOM 200
SURG 300
ROOM 400 <<<-- 600 less 200 .. wherein 600 is base on the basic amount limit as stated above
ROOM 200 <<<-- 400 less 200 .. wherein 200 is the allowable amount
ROOM 0 <<<-- 200 less 200 .. wherein 200 is the allowable amount

Back to Web Development Forum
7 total posts (Page 1 of 1)  

Related Discussions

Related Forums