Need trigger [message #658723] |
Sat, 24 December 2016 00:47 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](http://www.gravatar.com/avatar/712a2995e357be1d02e5e04badbab67f?s=64&d=mm&r=g) |
TOFARHAN
Messages: 19 Registered: June 2011 Location: farisalabad
|
Junior Member |
|
|
Dears,
In my form I create a text box that sum the amount. This sum is conditional. if your select type item then sum of these item. I show the result when he commit form or query the form. I write two trigger to achieve this result.
1) post_commit_form
2) post_query.
I need one trigger to achieve this result.
Regards,
Farhan.
|
|
|
Re: Need trigger [message #658737 is a reply to message #658723] |
Sun, 25 December 2016 01:33 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) |
![](http://www.orafaq.com/forum/images/custom_avatars/72104.gif) |
Littlefoot
Messages: 21811 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
Option I wouldn't recommend is to create a KEY-COMMIT trigger which would commit and EXECUTE-QUERY; that would fire POST-QUERY and run your code. However, as you can commit without KEY-COMMIT triggee, that is a bad solutuon.
Another one is to calculate sum in WHEN-VALIDATE-ITEM (or -RECORD?) trigger (so that you don't have to wait for commit to see the result), but you still need POST-QUERY.
Or, put your code into a procedure so that you don't have to maintain it in two triggers, and then call the procedure whenever needed.
A conclusion? In my opinion, you'll need 2 triggers anyway.
|
|
|