web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
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,909

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

I have the same question (0)
  • AXTechie2120 Profile Picture
    568 on at

    Hi,

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

    Regards,

    AXTechie2120

  • Faqruddin Profile Picture
    1,909 on at

    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.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans