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 ?