let itemSearch = search.create({
type: search.Type.ITEM,
columns: [‘internalid’, ‘name’, ‘parent’],
filters: [
[“type”, “anyof”, “InvtPart”],
“AND”,
[“isinactive”, “is”, “F”]
]
});
let pagedData = itemSearch.runPaged({ pageSize: 1000 });
pagedData.pageRanges.forEach(pageRange => {
let page = pagedData.fetch({ index: pageRange.index });
page.data.forEach(result => {
items.push({
id: result.getValue(‘internalid’),
name: result.getText(‘parent’) ? result.getValue(‘name’).replace(result.getText(‘parent’) + ‘ : ‘, ”) : result.getValue(‘name’),
});
});
});