Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Unit Conversion value By Selected warehouse on InventOnHandItemListPage Form

(0) ShareShare
ReportReport
Posted on by 1,881

Dear all,

I return the converted unit value with below code. But once I select the warehouse while opening the form InventOnHandItemListPage its returns converted value from all warehouses. I need converted unit value based on my warehouse selection only. Please let me know How can I achieve this.

//code on InventTableModule

public display InventQty availPhyQty()
{

    InventSum       inventSum;
    InventDim       inventdim;
    InventTable inventTable;
    InventQty      Qty;
    Qty _salesQty;
    SalesLine _salesLine;
    real value;
    UnitOfMeasureFromRecId  fromUnitOfMeasure;
    UnitOfMeasureToRecId    toUnitOfMeasure;

    fromUnitOfMeasure = UnitOfMeasure::findBySymbol("PC").RecId;
    toUnitOfMeasure = UnitOfMeasure::findBySymbol(this.UnitId).RecId;

    while select inventSum
        where inventSum.ItemId == this.ItemId
    {

      //select inventdim
        //where inventdim.inventDimId == _inventDimId;



  //if(inventdim.InventSiteId == this.inventDim().InventSiteId  &&   inventdim.InventLocationId == this.inventDim().InventLocationId)

         Qty += inventSum.physicalInventCalculated();


     }

 if (UnitOfMeasureConversion::findByConversion(fromUnitOfMeasure, toUnitOfMeasure) ||  UnitOfMeasureConversion::findByConversion(toUnitOfMeasure, fromUnitOfMeasure))

    {
         _salesQty = UnitOfMeasureConverter::convert(Qty, fromUnitOfMeasure, toUnitOfMeasure, NoYes::No, 0, NoYes::No);

        return _salesQty;
    }

    else
    {
        return Qty;
    }


}

//code on InventSum to return above value

Public display InventQty availPhyQty()
{
    return InventTableModule::find(this.ItemId, ModuleInventPurchSales::Purch).availPhyQty();
}

Thanks

Faqru

*This post is locked for comments

  • Faqruddin Profile Picture
    1,881 on at
    RE: Unit Conversion value By Selected warehouse on InventOnHandItemListPage Form

    Hello - I'm trying to return on hand physical inventory with converted unit value. I get on hand inventory value but its returns from all WHS. I need value with selected WH only while opening the InventOnHandItemListPage form.

  • AXTechie2120 Profile Picture
    568 on at
    RE: Unit Conversion value By Selected warehouse on InventOnHandItemListPage Form

    Hi,

    Can you please a  little bit on what you are trying  to do so that we can help you.

    Regards,

    AXTechie2120

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

Ramesh Kumar – Community Spotlight

We are honored to recognize Ramesh Kumar as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Kempeth Profile Picture

Kempeth 4

#1
Andy Adamak Profile Picture

Andy Adamak 4

#1
Community Member Profile Picture

Community Member 4

Featured topics

Product updates

Dynamics 365 release plans