Change CalcFormula from Inventory in Item table

tompynationtompynation Member Posts: 398
Hi,

is it possible to change the CalFormula of the Inventory field in the Item table to a more complex calculation...

So standard it looks like this:
Sum("Item Ledger Entry".Quantity WHERE (Item No.=FIELD(No.),Global Dimension 1 Code=FIELD(Global Dimension 1 Filter),Global Dimension 2 Code=FIELD(Global Dimension 2 Filter),Location Code=FIELD(Location Filter),Drop Shipment=FIELD(Drop Shipment Filter),Variant Code=FIELD(Variant Filter),Lot No.=FIELD(Lot No. Filter),Serial No.=FIELD(Serial No. Filter)))

This is good but this calculated value should me reduced by a sum of quantities in one of my custom tables...

How should i do this so that the reports who uses this inventory field will still work? With still work i mean that they should also use my new extended CalcFormula

Comments

  • kinekine Member Posts: 12,562
    Please, do not try to change this field definition. The consequences can be huge...

    Question is, if the table, you need to use for the calculation, is really needed and if the way you are solving the problem is good. But without the purpose, you want to reach, hard to say.

    Better and cleaner will be to subtract the value in the report directly, but I do not know, if this is needed only on the reports, or it must have some inpact to rest of the processes.
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • MonstaMonsta Member Posts: 38
    You should create one or more new flow fields in item table: one for each quantity you want to calculate in you custom table(s).
    In your report these new fields must be calculated along with Intentory field. After that just subtract fields' values from each other to get desired figure.
  • tompynationtompynation Member Posts: 398
    yes, but that means that i should addapt every report that uses the inventory field...

    Why would it be bet to just change that CalcFormule?
  • MonstaMonsta Member Posts: 38
    yes, but that means that i should addapt every report that uses the inventory field...
    Why would it be bet to just change that CalcFormule?

    Only one field from one table can be calculated in a flowfield. As I understand you want to subtract values from another table(s).
  • kinekine Member Posts: 12,562
    yes, but that means that i should addapt every report that uses the inventory field...

    Why would it be bet to just change that CalcFormule?

    Because it is done in this way. If you do not want to see some quantity on inventory, it means, that it is not there and the problem is in your data. If the quantity is not there, move it where it is, sale it, if it was sold, transfer it, if it was transfered... if it is "loaned", trransfer it to special location "loans". etc...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
Sign In or Register to comment.