Skip to main content

productUomChangePreview

Returns what changing a product's unit of measure would do to its stock, so the change can be confirmed before updateProduct saves it.

Business Rules​

  • A product whose stock is stored in its own unit keeps its numbers, which then mean the new unit.
  • A product stored in a metric unit (grams for kilograms) keeps its stored numbers when the new unit stores the same way, so stock reads in the new unit.
  • A product stored in a metric unit cannot change unit while it is a component in another product's bill of materials.
  • A change that keeps the same storage unit, such as kilograms to pounds, is refused while open purchase order or shipment lines use the product's unit. Lines with their own unit, and shipments already received, do not count.
  • A change to another storage unit is refused while the product has any open purchase order or unreceived shipment lines.
  • A change that would store stock in a different unit also needs the product to have no stock or allocations. Stock at available-to-make locations is not counted.
  • That change also resets the restock threshold to 0, unless the same updateProduct sets a new one, because the old threshold is in the old storage unit.
  • Units smaller than the unit stock is stored in, such as milligrams, are not allowed.

Authentication & Permissions​

Requires authentication and the get_product_details permission for the product's company.

Possible Errors​

  • **Product not found**: the product does not exist.
productUomChangePreview(
productId: ID!
uom: ProductUomEnum!
): UomChangePreview!

Arguments​

productUomChangePreview.productId ● ID! non-null scalar common​

The product whose unit of measure would change.

productUomChangePreview.uom ● ProductUomEnum! non-null enum products​

The new unit of measure.

Type​

UomChangePreview object products​

What changing a product's unit of measure would do to its stock.