Calculate Flowfield using other fields in the same table

jgutzmjgutzm Member Posts: 4
Hello,

I have a developing question. I want to create three fields in the
Item table:

- Astore: Flowfield that calculates how many items are in the A
store. This is the Calcformula property:
Sum("Item Ledger Entry".Quantity WHERE (Location Code=CONST(Astore),Item
No.=FIELD(No.)))

- Bstore: Flowfield that calculates how many items are in the B
store. This is the Calcformula property:
Sum("Item Ledger Entry".Quantity WHERE (Location Code=CONST(Bstore),Item
No.=FIELD(No.)))

- TotalStore: Flowfield that sums A and B store. How I do it?

I need to applying filters to Totalstore field. For example:
recItems.SETFILTER(TotalStore,'>%1',0);

Using a table Item function and doing the call on AfterGetRecord Trigger
form is not a good solution for me.

This is an example, I need to adding two or more flowfield fields in a
field.

Thanks for your help.

Comments

  • kapamaroukapamarou Member Posts: 1,152
    Have you looked at how Inventory is defined in table 27 Item?

    You can create a flowfilter field like "Store Filter" similar to "Location Filter" and calculate the Sum not based on the two flowfields but by applying the Sum logic on the field.
  • jgutzmjgutzm Member Posts: 4
    Thanks for you answer kapamarou.

    The formula that I have to use it in TotalStore flowfield is more complex. Is like this:

    TotalSotre:=Inventory+"Qty. on Purch. Order"-(AStore+"Qty. on Sales Order"+"Qty. on Sales Deposit"
    +"Qty. on Production orders"+"Minimum stock"+BStore)

    How I do it if all of the fields in this formula are flowfields?
  • ufukufuk Member Posts: 514
    No way by flowfield. You cannot sum values from different tables.
    Why you don't want to use a function? If not, you have to use normal field and update its value when you need it or while posting etc.
    Ufuk Asci
    Pargesoft
  • jgutzmjgutzm Member Posts: 4
    Thanks ufuk.

    I need a flowfield because there are a lot of points in Dynamics that I have to update this value manually. It's a value that is linked with stock.
    One solution would be update this value on table triggers, but not always a field is added/updated/deleted with TRUE parameter.
  • bryanpbryanp Member Posts: 1
    edited 2020-11-18
    Did you find a solution for this? Or anyone knows how to do it in Microsoft Nav 2018?
Sign In or Register to comment.