Skip to main content

Notifications

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 516
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
  • Suggested answer
    Hana Xue Profile Picture
    Hana Xue Microsoft Employee on at
    How to convert purchase quantity to inveotry quantity if UoM different using X++ ?
    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
  • Ken Manhattan Profile Picture
    Ken Manhattan 516 on at
    How to convert purchase quantity to inveotry quantity if UoM different using X++ ?
    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
     
     
  • Verified answer
    André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 291,965 Super User 2025 Season 1 on at
    How to convert purchase quantity to inveotry quantity if UoM different using X++ ?
    Hi Ken,
     
    Depending on your exact requirement, there are various methods available on the PurchLine table:
    - modifyPurchQty
    - initPurchQty
    - unitConvertPurch2Invent
    - unitConvertInvent2Purch
     

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,965 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,817 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans