web
You’re offline. This is a read only version of the page.
close
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,883

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,883 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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans