Is there a form trigger that fires when the form is refreshed or updated?
I have added a "Total Amount" field to Form 256 Payment Journal. When the batch name is chosen in the combo box, the screen does a setrange on the General Journal Line table. I have a little piece of code that sums the Amounts of the displayed records to the variable that is the source code of the "Total Amount" field. But I can't find a trigger to put the code in. If I put it in form.OnOpen() it works, and displays the total amount of the batch that the form defaults to, but I can't find a trigger that runs the code when the batch is changed.
Putting the code in the OnValidate and OnAfterValidate of the batch combo box doesn't work.
Any suggestions?
0
Answers
-a
On Trigger Add Create Function Add text box at bottom of the form
SourceExp : JournalAmt
If I remember correctly you need to then add a SumIndexField(Amount) to one of the keys of the Gen Journal Line table
http://www.BiloBeauty.com
http://www.autismspeaks.org
(I had forgotten the CALCSUMS function :oops: )
Just for grins I tried putting this code in OnAfterGetRecord and I got an error: "There is insufficent memory (stack) to execute this operation. This can be due to the way recursive function calls are used in the program." So then I put Savatage's code in OnAfterGetRecord and got the same message, so guess I'm sticking with my messy(?) solution.
That is the exact code I use and it's the OnAfteGetCurrRecord Trigger.
Works fine
here's the old orig post
http://www.mibuso.com/forum/viewtopic.php?t=7692
http://www.BiloBeauty.com
http://www.autismspeaks.org