Home » Developer & Programmer » Forms » Handling formula Data (Calculation) stored in tables in Oracle forms (Forms 6i)
Handling formula Data (Calculation) stored in tables in Oracle forms [message #430698] Wed, 11 November 2009 16:32 Go to next message
nathanvijay77
Messages: 22
Registered: October 2008
Junior Member
Hi,

I have the following database fields users choose-Raw Material1, Raw Material2, Qty, No of shipments, color, plant

Based on these input fields and predefined gross profit margins, I have written a PL/SQL function and registered in database which gives the low and high prices. This low and high price is a database table field as well.

I have created 2 fields in forms (non table) and inserted the function to find high and low prices in property pallatte. When saving the record, I have written pre-insert trigger to copy the low and high values to corresponding table columns.

This works OK when I create new entries. However when I query for existing data, the two fields on the form (non database fields) always show the calculation based on the present values. It is possible that cost of some of items may have changed since the time records were created and these 2 fields always show new cost. For example, when data got created, low and high prices were 5 and 10 and now they are 7 and 12. The system should show 5 and 10 but will show only 7 and 12 based on new calculations.

How can this issue be resolved? Thanks in advance
Re: Handling formula Data (Calculation) stored in tables in Oracle forms [message #430705 is a reply to message #430698] Wed, 11 November 2009 18:24 Go to previous message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
Well if you're storing the old high and low values in the database all you should need to do is use the post-query trigger to populate the non-database items.
You'll probably find it easier to not put the function in the property palette but call it from triggers instead.

And since this follows directly on from your previous thread it would have made more sense for you to post this there.
Previous Topic: Calling PL/SQL function in a form
Next Topic: progress bar based on stored procedure
Goto Forum:
  


Current Time: Fri Sep 20 09:48:18 CDT 2024