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 :
Finance | Project Operations, Human Resources, ...
Answered

How to convert purchase quantity to inveotry quantity if UoM different using X++ ?

(0) ShareShare
ReportReport
Posted on by 552
Hi all,
 
How to convert purchase quantity to inventory quantity if UoM different using X++ ? is there a built-in function for it and how to use it ?
Thanks
I have the same question (0)
  • Verified answer
    André Arnaud de Calavon Profile Picture
    301,020 Super User 2025 Season 2 on at
    Hi Ken,
     
    Depending on your exact requirement, there are various methods available on the PurchLine table:
    - modifyPurchQty
    - initPurchQty
    - unitConvertPurch2Invent
    - unitConvertInvent2Purch
     
  • Ken Manhattan Profile Picture
    552 on at
    Hi Andre,
     
    Thank you very much. I wish I knew sooner.
    I'm going "extra mile" before reading your reply and using this rather complex way :
     
    InventQty = PurchQty * UnitOfMeasureConversion::findByConversion(
                                                                UnitOfMeasure::unitOfMeasureIdBySymbol(InventTable::find(purchLine.ItemId).inventTableModulePurch().UnitId),
                                                                UnitOfMeasure::unitOfMeasureIdBySymbol(InventTable::find(purchLine.ItemId).inventTableModuleInvent().UnitId)
                                                                ).Factor;
     
    But thanks, I will use yours from now on
     
     
  • Suggested answer
    Hana Xue Profile Picture
    Microsoft Employee on at
    Hi Ken,
    You can check out this article for PO Quantity vs. Inventory Quantity, although it doesn't use the X++ method.
    You can also view related information about the purchline table:
    Quantities in purchase order and inventory transaction - Microsoft Dynamics 365 Blog
    PurchLine in WorksheetLine - Common Data Model - Common Data Model | Microsoft Learn
    Best Regards,
    Hana

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 > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 646 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 529 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 285 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans