createTableFromProductExtension

def pxTableName = "Product_Costs"
def pxAttrs = ["ProductID": "sku", "AvgCosts": "attribute1", "Supplier": "attribute3"]
def inMemoryTableName = "TableAttrs"
def fields = pxAttrs.values()
def tableContext = api.getTableContext()

tableContext.createTableFromProductExtension(inMemoryTableName, pxTableName, fields)

def resultIterator = api.stream("PX", null, Filter.equal("name", pxTableName))
if (resultIterator) {
    tableContext.loadRows(inMemoryTableName, resultIterator)
}

api.trace("Tables", null, tableContext.printTablesDefinitions("%"))
api.trace("Tables 1 Count", null, tableContext.count(inMemoryTableName))


Found an issue in documentation? Write to us.

Â