How to sum decimal FlowFields from a table for a report?

Rob_BurkeRob_Burke Member Posts: 10
Hi folks,

I have applied all my filters and I've been trying to sum two columns from a table for a report in Navision 3.70b - one was working perfectly but the other kept on returning 0.00, upon further investigation, the only difference I can find between the columns is that one is a Normal Field Type and the other is a FlowField.

Is there a special way of calculating or in some other way summing the total value of flowfields in a table after filters have been applied?

Thanks a million,
Cheers,
Rob

Answers

  • sandy_bsilsandy_bsil Member Posts: 40
    use CALCFIELDS Function after the filter is applied to calcluate the value of the flowfield..
    Sandeep B
  • Rob_BurkeRob_Burke Member Posts: 10
    How can I then sum the value of the calculated fields?

    I'm trying the following:
    // My filters are applied here...
    
    TransInfocodeEntry.CALCFIELDS("Discount Amount");
    
    IF TransInfocodeEntry.FIND('-') THEN REPEAT
       ValueOfStaffDiscounts += TransInfocodeEntry."Discount Amount";
       NoOfStaffDiscounts += 1;
    UNTIL TransInfocodeEntry.NEXT = 0;
    

    ValueOfStaffDiscounts is still staying at 0.00 though?
  • Rob_BurkeRob_Burke Member Posts: 10
    I actually figured it out myself, the problem seemed to be with *where* I was calling CALCFIELDS.

    I modified the code to this:
    // My filters are applied here...
    
    IF TransInfocodeEntry.FIND('-') THEN REPEAT
       TransInfocodeEntry.CALCFIELDS("Discount Amount");
       ValueOfStaffDiscounts += TransInfocodeEntry."Discount Amount";
       NoOfStaffDiscounts += 1;
    UNTIL TransInfocodeEntry.NEXT = 0;
    

    And it's working fine now. Thanks a million for your help mate!
Sign In or Register to comment.