customerRecord.RESET;
customerRecord.SETFILTER("Credit Limit (LCY)",'>%1',"Balance (LCY)");
IF customerRecord.FINDSET THEN BEGIN
customerRecord.Blocked := 2;
customerRecord.MODIFYALL(TRUE);
END;
customerRecord.RESET
....
....
Here "Balance (LCY") is a Flow Field and I don't do any CALCFIELDS anywhere here.
Or
Is there a better way to block all this customers who meet the condition without repeating through the entire table by REPEAT...UNTIL loop?
Shafdo
Comments
That code won't work, not because the CALCFIELDS is missing, mat mainly because the value of "Balance (LCY)" is evaluated and used in the filter at the time SETFILTER is called, not at the time a prospect record is examined as to whether it meats the filter criteria (that was kind of cool =P~).
I can't think of one.
I will suggest to run a batch job during night until I learn a better a way, if there is any.
Thank you
Do you mean to "calculate" the balance from cust. ledger entries by summing? Can you elaborate a bit please.
Thanks
To get the balance you need the sum of detailed customer ledger entries, but rather than adding them up yourself use the FlowField on the customer or use a CALCSUMS command on Detailed Cusomer Ledger Entries to take advantage of the pre-computed sum in the SumIndex/SIFT.
Of course this still has an impact on performance of posting routines, but because of the SIFT probably not a severe one.