Effect on performance when adding new FlowField in a table
Comments
-
It depends...0
-
Yes, it depends on how the flowfield is defined and mainly on how it is used.0
-
Flowfields are calculated when used, so it is when used that consume time.
Try to show lot of flowfields on a form for a large table and you'll see how slow it gets...
Salut!Laura Nicolàs
Author of the book Implementing Dynamics NAV 2013
Cursos Dynamics NAV (spanish) : http://clipdynamics.com/ - A new lesson released every day.0 -
And because for SUMs you can define SumIndexFields, they could have effect when inserting/modifying the records too... it is not just about displaying ;-)0
-
Thank all of you for all your responses.kine wrote:Yes, it depends on how the flowfield is defined and mainly on how it is used.kitik wrote:Flowfields are calculated when used, so it is when used that consume time.
Try to show lot of flowfields on a form for a large table and you'll see how slow it gets...Regards,
Andwian0 -
Actually, what I am going to do is to check whether the customer have any Balance at one Date.
So there are two ways in my head:
1. Create a new FlowField "Balance at Date" and make it invisible in the Customer Card form.EXIST("Cust. Ledger Entry".Open WHERE (Customer No.=FIELD(No.),Due Date=FIELD(UPPERLIMIT(Date Filter))))
Then in my code, I just:CALCFIELDS("Balance at Date"); IF "Balance at Date" > 0 THEN ERROR('Overdue Balance');
2. Do the SETFILTER on Cust. Ledger Entries, and then CustLedgEntry.ISEMPTYCustLedgerEntries.RESET; CustLedgerEntries.SETCURRENTKEY(Customer No.,Open,Positive,Due Date,Currency Code); CustLedgerEntries.SETRANGE("Customer No.","Sell-to Customer No."); CustLedgerEntries.SETFILTER("Due Date",'<%1',"Document Date")); CustLedgerEntries.SETFILTER(Open,TRUE); IF CustLedgerEntries.FINDFIRST THEN //or can be: IF NOT CustLedgerEntries.ISEMPTY THEN ERROR('Overdue Balance');
From those two approaches, please everyone kindly advice which one is a greater idea.
Kindly let me know your thought. Thank you.Regards,
Andwian0 -
First case: You will need sumindexfield added for the appropriate index to have SIFT view for calculating the sum. This will need some maintenance during inserts/modify/delete for each record, but will give you the sum quickly when needed even when you will have many entries.
Second case: You will need good index to be able to quickly filter the correct entries (of course, you need that in first case too)
All depends on possibility to need to know exact amount or calculate the balance to some given date. If you need the amount or to calc it to some date, the flowfield is better.0 -
kine wrote:First case: You will need sumindexfield added for the appropriate index to have SIFT view for calculating the sum.kine wrote:Second case: You will need good index to be able to quickly filter the correct entries (of course, you need that in first case too)kine wrote:All depends on possibility to need to know exact amount or calculate the balance to some given date. If you need the amount or to calc it to some date, the flowfield is better.Regards,
Andwian0 -
If you need only exists/not exists, than just set the filter and use ISEMPTY to check if there are some records inside the filter or not. If you have good index for SQL to apply the filters (index with good selectivity), the answer will be quick. No need to define flowfield for that. But again, all depend on other things like if you plan to test this condition on more places in the solution, if you want to disply check box with the value to user etc. Regarding other things- I recommend to learn more about the flowfields and indexes from the documentation.0
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