DELETEALL with filter on FlowField

Eugene
Member Posts: 309
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:
if this one above is not optimized by Navision maybe the following does:
i really dont want to go with this just to delete records based on flowfield value:
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
0
Comments
-
Hi Eugene
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
Claus0 -
[Topic moved from Dynamics NAV to Navision forum]0
-
(filters on flowfields only works in forms where the form performs the calcfields).
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.0 -
Quote:
(filters on flowfields only works in forms where the form performs the calcfields).
This is not true. You can set ranges on flowfields.
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
Claus0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions