cannot pass value from one form to another although using global variable!! [message #673994] |
Thu, 20 December 2018 14:15 |
|
Oraclinho
Messages: 9 Registered: December 2018
|
Junior Member |
|
|
I have 2 forms one for prices of types and the other for the types. I want to pass the price of one piece of that type from the 1st form to the second form to calculate the total price by multiplying the price by the number of pieces of that type. I want to calculate the total price when I add the number of pieces directly to the price display item.
I added pre_text_item trigger to the price item in the 1st form and here is its code:
:global.price_new := :price_new;
in the other hand, I added when_validate_item trigger to the number of pieces item and here is its code:
declare
no_types number;
begin
select type_num
into no_types
from types, prices
where types.type_name = prices.type_name;
if no_types is not null then
:types.price := :global.price_new * no_types;
else
message('There is no price for that type. Please add a price for it in price page.');
message('There is no price for that type. Please add a price for it in price page.');
end if;
end;
I wanna to show the total price in price item in the 2nd form when I press tab to navigate from number item to price item, but I the mouse cursor don't move and stuck in number item with that error:
FRM-40735: when_validate_item trigger raised unhandled exception ORA-01403
any help to solve that error and perform that action in the form ??
[EDITED by LF: applied [code] tags]
[Updated on: Fri, 21 December 2018 01:10] by Moderator Report message to a moderator
|
|
|
|
|
Re: cannot pass value from one form to another although using global variable!! [message #674655 is a reply to message #674000] |
Thu, 07 February 2019 07:22 |
|
Neveen2019
Messages: 13 Registered: February 2019
|
Junior Member |
|
|
Hi
Sorry, but if i were you i would redesign my database table to an invoice form which will include one form with item_no, price, quantity.
No need for a Global. If it is necessary to follow this current design then, you must involve the exception section with any select statement.
Besides, it is strongly recommended to destroy 'Global variables' at the moment you don't need anymore.
|
|
|