Tuesday, July 8, 2014

OnHand Qty from item ID in Table AX 2012

// To get On Hand Qty from item ID in Table


display InventQty qty()    //Real

{
    return InventSum::hhtAvailPhysical(this.ItemId) +
        ( select sum(Ordered) from inventSum where inventSum.ItemId == this.ItemId).ordered +
            ( select sum(Arrived) from inventSum where inventSum.ItemId == this.ItemId).Arrived -
                ( select sum(ReservOrdered) from inventSum where inventSum.ItemId == this.ItemId).ReservOrdered -
                    ( select sum(OnOrder) from inventSum where inventSum.ItemId == this.ItemId).Onorder ;
}

No comments:

Post a Comment

Search hierarchy for a match (TableALLGroup) X++

  Table1 ppt;  select firstonly ppt  order ItemCode, ItemRelation, AccountCode, AccountRelation where      (ppt.ItemCode == TableGroupAll::T...