Skip to Main Content

Oracle Forms

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

quantity validation

Eslam_ElbyalyDec 3 2015 — edited Dec 16 2015

hi , forms 6i ,

it's a form for selling items .

- the scenario :-

i sell an item with a specific unit , and use factors to convert the quantity to the small unit  , in order to update the qty in the stock .

- i have a non-db item on the form called " qty_in_min_unit " , it is source is a formula which calculates the qty in min unit , then i use the result to update the stock's qty .

- the form is for insert , update , delete and query .

the problem :-

suppose that i created an invoice and i've sold 4 packets of biscuits , and there is 1 packet of biscuits in the stock after creating that invoice , then i want to update that record in the form

and make it 5 not 4 .

in the when-validate-record or in pre-update , i check the quantity in the stock , if it is not enough , then message , and raise form_trigger_failure .

so , if i update the 4 packets to 5 , it will prevent him from navigating , because 5 > 1 which is the rest in the stock , but off course it should not prevent the user because he only used the 1 packet in the stock .

so , i want to say ,

if qty after update - qty before update > qty in the stock

then

message...

raise form_trigger_failure ; .......

how to say so ?

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 13 2016
Added on Dec 3 2015
24 comments
5,029 views