CALCFIELDS in the same table where the FlowField is?

abartonicek
Member Posts: 162
I have 3 FlowFields with SUM method in Item table. Each of that FlowFields are calculating theirs sums per Item for every line in Sales Line or Purchase Line (for that Item).
Now I need to SUM all sums for Items in the same Class.
I wanted to create a SumIndexField but I can't do it with FlowField, so I created decimal field that will have that FlowField value.
The problem is that I don't know how to put FlowField value to that decimal field.
I tried this:
OnValidate(of FlowField)
It doesn't work
What am I doing wrong?
Now I need to SUM all sums for Items in the same Class.
I wanted to create a SumIndexField but I can't do it with FlowField, so I created decimal field that will have that FlowField value.
The problem is that I don't know how to put FlowField value to that decimal field.
I tried this:
OnValidate(of FlowField)
CALCFIELDS(FlowFieldName); DecimalField := FlowFieldName;
It doesn't work

What am I doing wrong?
Better to be critical then self-critical 

0
Comments
-
This is not going to work this way.
Beter is to make a flowfield in the item table with the class field and without the item no. It may sounds a bit odd, but you will have the value you want to calculate in a new flowfield.0 -
I don't get it.
I have to sum all lines in Sales Line where Item No. is from some Item Class BUT lines in Sales Line doesn't have Class field so the only relation I have is by Item No.
Could you explaine your idea a bit more?Better to be critical then self-critical0 -
OK, the fact that sales line does not have the class field complicates things a little.
I don't think a flowfield is possible in this case...
Have you thougt of making the class field available in the sales line/puchase line?0 -
I think that will be the fastest solution.
I should auto fill that field on every new record, wright?Better to be critical then self-critical0 -
-
Yes, There is some code in the validation of the No. field. You should add some code there to populate the class field from the item table.
Also you need to make some update report that populates the old lines.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