api.product()

The method api.product() has been deprecated in 14.0 version.

Deprecated Usage

api.currentItem()

Use of the api.currentItem() method for retrieval of the SKU field.

Groovy
def sku = api.currentItem("sku")

api.product()

Groovy
def sku = api.product("sku")

def label = api.product("label")
def productGroup = api.product("ProductGroup")
def brand = api.product("Brand")
def uom = api.product("unitOfMeasure")

QueryApi Usage

Make a Product Master.

Groovy
def qapi = api.queryApi()

def p = qapi.tables().products()

def sku = api.currentItem("sku")

def product = qapi.source(p, [
        p.sku(),
        p.label,
        p.ProductGroup,
        p.unitOfMeasure()
], p.sku().equal(sku))
        .stream { it.find() }

def label = product.label
def productGroup = product.ProductGroup
def uom = product.unitOfMeasure

Result

sku

label

productGroup

uom

10000001

Spare part 10000001

00L

KG

See Also