i want to ask if the following code get optimized by Navision and if not is there a better(faster to execute) way to this:
MyRec.SETFILTER(MyFlowFld, 'ValuesToBeDeleted');
MyRec.DELETEALL
if this one above is not optimized by Navision maybe the following does:
MyRec.SETRANGE(MyFlowFld, 'OneValueToBeDeleted');
MyRec.DELETEALL
i really dont want to go with this just to delete records based on flowfield value:
MyRec.FIND('-'')
REPEAT
MyRec.CALCFIELDS(MyFlowField);
IF MyRec.MyFlowField='ValueToBeDeleted' THEN
MyRec.DELETE;
UNTIL NEXT=0
Comments
Have you tested the three cases? As far as I know the two first won't work as you can't set filters on flowfields form code (filters on flowfields only works in forms where the form performs the calcfields). Your only option seems to be last case. Anyway Navision will have to calculate all the flow fields to evaluate what to delete and this is what takes time, reading the record with the flowfield will usual not take much time compared to the calculation of the flowfield.
Regards
Claus
http://www.AcumenConsulting.co.nz
This is not true. You can set ranges on flowfields.
I assume you are using SQL and that is why you are raising the performance isssu? You should test each case and see which one i best.
Sometimes the deleteall can take some time if you have a huge recordset.
Sorry, what a nice surprise. I haven’t really tested this in years so I just assumed it didn’t work. I just tried a 2.60 and filters on flowfields don’t work, however it works fine in 4.0. Thanks for correcting me JohnCon.
Regards
Claus
http://www.AcumenConsulting.co.nz