Flowfield

sabzamsabzam Member Posts: 1,149
Dear All,

I need to create a flowfield but which sums up a number of columns and this function is not present in the default flowfield functions. Anyone has got any idea how this can be done?

Comments

  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    First create different flowfields with the SUM-CalcFormula, for each column:

    Flowfield1: SUM of a specific column A in another table
    Flowfield2: SUM of a specific column B in another table
    Flowfield3: SUM of a specific column C in another table

    On your form, you can then add a TextBox-control with following SourceExpr: Flowfield1 + Flowfield2 + Flowfield3
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • David_SingletonDavid_Singleton Member Posts: 5,479
    First create different flowfields with the SUM-CalcFormula, for each column:

    Flowfield1: SUM of a specific column A in another table
    Flowfield2: SUM of a specific column B in another table
    Flowfield3: SUM of a specific column C in another table

    On your form, you can then add a TextBox-control with following SourceExpr: Flowfield1 + Flowfield2 + Flowfield3

    Unfortunately I think that this wont work, it will return zero. You need to put a calcfields int here somewhere, and this can only be done in code. Unfortunately the Form Property "CALCFIELD" is there purely for decoration.

    If you want to do this without code, then you need to add all three fields to the form so that they are calculated.
    David Singleton
  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    If you want to do this without code, then you need to add all three fields to the form so that they are calculated.
    Indeed. Don't know if the 3 flowfields are calculated, if they are present on the form with Visible = No.
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • nunomaianunomaia Member Posts: 1,153
    First create different flowfields with the SUM-CalcFormula, for each column:

    Flowfield1: SUM of a specific column A in another table
    Flowfield2: SUM of a specific column B in another table
    Flowfield3: SUM of a specific column C in another table

    On your form, you can then add a TextBox-control with following SourceExpr: Flowfield1 + Flowfield2 + Flowfield3

    Unfortunately I think that this wont work, it will return zero. You need to put a calcfields int here somewhere, and this can only be done in code. Unfortunately the Form Property "CALCFIELD" is there purely for decoration.

    If you want to do this without code, then you need to add all three fields to the form so that they are calculated.

    Yes, you are right. FlowFields are only automatically calculated in a direct source expression. In indirect source must be place CALCFIELDS in Form after getting record.
    Nuno Maia

    Freelance Dynamics AX
    Blog : http://axnmaia.wordpress.com/
  • David_SingletonDavid_Singleton Member Posts: 5,479
    If you want to do this without code, then you need to add all three fields to the form so that they are calculated.
    Indeed. Don't know if the 3 flowfields are calculated, if they are present on the form with Visible = No.

    When a form opens, it looks to see which fields are currently visible on the form, and these fields are then added to the list of fields to be calculated. If you then make the fields non visible, then they will continue to calculate, but i you close the form and re-open it, then they are no longer calculated.

    If you don't have access to code, then you can do it by creating a function in a report. Other wise you have to have all three fields visible, you can do this by adding them directly on the form, and then hiding them under some control.
    David Singleton
  • sabzamsabzam Member Posts: 1,149
    I must have been misunderstood; the flowfield which I need to create is to be created in a table and not in a form. Practically I have a column which should be the summation of three columns which are found in the same table. for example I have tabel with columns A, B, C and D. I need that D to be the summation of A + B +C
  • David_SingletonDavid_Singleton Member Posts: 5,479
    sabzam wrote:
    I must have been misunderstood; the flowfield which I need to create is to be created in a table and not in a form. Practically I have a column which should be the summation of three columns which are found in the same table. for example I have tabel with columns A, B, C and D. I need that D to be the summation of A + B +C

    Yes you are correct. For some silly reason, when you said FLOWFIELD, I thought you meant you wanted to use a flow field. :mrgreen:

    In your case, I guess what you really want is to store the sum of A,B,C in a new field D and have that value saved in the table.

    Or if all you need is to know the sum of the fields, just use
    D := A + B + C; where ever you need the number.

    Where are you planning to use this field "D" ?
    David Singleton
Sign In or Register to comment.