community postAL Developmentcommunity - not Microsoftreviewed - checked by Opus

BC Friday Tips #32 Unit of Measure Management Codeunit

The Unit of Measure Management codeunit provides built-in functions for handling unit of measure conversions and quantity calculations in Business Central. Developers should use it instead of creating custom solutions to ensure consistency and save development time.

post That NAV Guy

Teddy Herryanto · 2025-05-23 · 69 words · about 1 min

"Use it next time you are dealing with Unit of Measure conversions."

Key points

  • The Unit of Measure Management codeunit offers functions such as GetQtyPerUnitOfMeasure, GetResQtyPerUnitOfMeasure, GetQtyRoundingPrecision, RoundQty, CalcBaseQty and CalcQtyFromBase
  • Reusing the codeunit means developers do not have to write their own unit of measure conversion logic
  • The stated benefits are saving time and keeping results consistent

Quotes

  • “Use it next time you are dealing with Unit of Measure conversions.” (Recommends leveraging the standard codeunit as a development best practice for UoM handling)
  • “No need to reinvent the wheel.” (Emphasizes the importance of using built-in functionality instead of custom solutions)

AL objects mentioned

As named in the post. A name that matches one object page by exact type and name links to it; the others stay as named.

Context

  • Features: GetQtyPerUnitOfMeasure, GetResQtyPerUnitOfMeasure, GetQtyRoundingPrecision, RoundQty, CalcBaseQty, CalcQtyFromBase

Source: That NAV Guy, community blog. Summary, key points and quotes are derived (CONTENT-NOTICE.md); read the original for the full text.