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

Announcements

No record found.

News and Announcements icon
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 558
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
  • Verified answer
    André Arnaud de Calavon Profile Picture
    307,224 Super User 2026 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
    558 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

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 August Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 475 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 399 Super User 2026 Season 2

#3
CU10121822-0 Profile Picture

CU10121822-0 374

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans