Hi,
i like to add a small code to a Form. Goal: the user select 1 to ? lines in a table and under the table i have a sum for this selection.
OnAfterGetCurrRecord:
CurrForm.SETSELECTIONFILTER(TerminBauteil2);
dickesum := 0;
IF TerminBauteil2.FINDSET THEN
REPEAT
dickesum += TerminBauteil2."Dicke (mm)";
UNTIL TerminBauteil2.NEXT = 0;
Problem: The sum is not correct. Most times the last selected or deselected row is not included. Or if i select 4 Lines at once i have only the sum for 1 Line... after clicking on another line the sum is from the last 4 lines?!
If i put the code on a extra button, it is working. It Looks like the table have to lost the Focus for exact Response?
Have somebody a trick or Workaround for this?
NAV Version 4.0
many thanks
Mathias
Answers
I don't think there is any way of achieving correct automatic calculation other than by using a timer, or some other automation with events.