CALCFIELDS in the same table where the FlowField is?

abartonicekabartonicek Member Posts: 162
edited 2005-12-20 in Navision Attain
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)
CALCFIELDS(FlowFieldName);
DecimalField := FlowFieldName;

It doesn't work :(
What am I doing wrong?
Better to be critical then self-critical :)

Comments

  • Marije_BrummelMarije_Brummel Member, Moderators Design Patterns Posts: 4,262
    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.
  • abartonicekabartonicek Member Posts: 162
    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-critical :)
  • Marije_BrummelMarije_Brummel Member, Moderators Design Patterns Posts: 4,262
    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?
  • abartonicekabartonicek Member Posts: 162
    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-critical :)
  • kinekine Member Posts: 12,562
    Yes, you got it...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • Marije_BrummelMarije_Brummel Member, Moderators Design Patterns Posts: 4,262
    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.
Sign In or Register to comment.