Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Unanswered

What is the logic behind the Sum of "On Hand Qty" field in the Inventory aging report using x++

(2) ShareShare
ReportReport
Posted on by 68
Hello,
anyone can give the code/mapping of Sum of "On-Hand Qty"field in the inventory aging report?
Path:cost managementèinquiries and reportèphysical inventory reportè inventory aging.
Categories:
  • ISDev Profile Picture
    ISDev 68 on at
    What is the logic behind the Sum of "On Hand Qty" field in the Inventory aging report using x++
    here is my code:
    i need to get the sum on hand quantity from the inventory aging report  to be equal to tmpItemTrans.OnHandAsOfDate.
    Private void processItemTrans()
        {
            InventTable                 inventTable;
            InventTrans                 inventTrans, inventTransExists;
            ProdReportItemTable     prodReportItemTable;
            InventItemGroupItem         inventItemGroupItem;
            UnitOfMeasureSymbol         inventUnit;
            Qty                         SumQty_Prod,
                                    SumQty_Prod_OnSpec,
                                    SumQty_Prod_OffSpec,
                                    OnHandOnSpec,
                                    OnHandOffSpec,
                                    OnHand,
                                    Qty_ProdLine,
                                    Qty_Registered;
    
    
    
            while select   ItemId, Product from InventTable exists join InventItemGroupItem where InventItemGroupItem.ItemId == InventTable.ItemId
           exists join prodReportItemTable where prodReportItemTable.ItemGroupId == InventItemGroupItem.ItemGroupId
            && prodReportItemTable.Active
            {
                inventUnit=  InventTableModule::find(InventTable.ItemId, ModuleInventPurchSales::Invent).UnitId;
    
                //SumQty_Prod         = this.SumQty_InventTrans(InventTable.ItemId, TransDate, TransDate, InventTransType::Production);
                SumQty_Prod         = this.SumQty_TagTrans(InventTable.ItemId, TransDate, TransDate, ProdTagType::Packed);
                info(strFmt("%1 %2", InventTable.ItemId,SumQty_Prod));
                SumQty_Prod_OnSpec  = this.SumQty_InventTrans_Spec(InventTable.ItemId, TransDate, TransDate, InventTransType::Production, wMSPalletSpecificationStatus::OnSpec);
                SumQty_Prod_OffSpec = this.SumQty_InventTrans_Spec(InventTable.ItemId, TransDate, TransDate, InventTransType::Production, wMSPalletSpecificationStatus::OffSpec);
    
                OnHand          = this.OnHand(InventTable.ItemId);
                OnHandOnSpec    = this.OnHandSpecStatus(InventTable.ItemId, wMSPalletSpecificationStatus::OnSpec);
                OnHandOffSpec   = this.OnHandSpecStatus(InventTable.ItemId, wMSPalletSpecificationStatus::OffSpec);
    
                Qty_Registered = this.SumQty_InventTrans_Received(inventTable.ItemId, transDate, transDate, InventTransType::Purch);
                Qty_ProdLine = this.SumQty_InventTrans(InventTable.ItemId, TransDate, TransDate, InventTransType::ProdLine) * -1;
    
    
                tmpItemTrans.clear();
                tmpItemTrans.ItemId = InventTable.ItemId;
                tmpItemTrans.ItemName = InventTable.itemName();
     
                tmpItemTrans.OnHandAsOfDate = this.OnHand(InventTable.ItemId, TransDate);
     
  • Martin Dráb Profile Picture
    Martin Dráb 230,817 Most Valuable Professional on at
    What is the logic behind the Sum of "On Hand Qty" field in the Inventory aging report using x++
    Your problem description is too vague. Please show your current code and explain how the current behaviour differs from the intended one.
  • ISDev Profile Picture
    ISDev 68 on at
    What is the logic behind the Sum of "On Hand Qty" field in the Inventory aging report using x++
     
    Yes, it's  a sum of On-hand quantity values. im facing issue with getting same logic and use it on a custom report. i checked the code but it i didnt get what i need, so please can u provide the code that i need to add in my DP class to retreive same value?
     
    ThANKS
  • Martin Dráb Profile Picture
    Martin Dráb 230,817 Most Valuable Professional on at
    What is the logic behind the Sum of "On Hand Qty" field in the Inventory aging report using x++
    I'm assumming it's simply a sum of On-hand quantity values shown above. They likely come from InventAgingTmp.InventQty field, which seems to be populated from InventAgingCmdMapQuery.parmQty(). There is some more complex logic that can take the quantity from several different views, e.g. InventAgingQtyReportView.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,965 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,817 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans