Which permission is this referring to?
Your search contains a reference to join for which you do not have a permission: InventoryNumber
In an attempt to discover the permission I tried loading a record of type record.Type.INVENTORY_NUMBER and got an error saying I needed Lists > Items, so I added that to my role and then retried the search, but the search continues to fail with the same error ("Your search contains a reference to join for which you do not have a permission: InventoryNumber").
In another attempt to discover the permission I tried a search of type search.Type.INVENTORY_NUMBER and got the same error saying I needed Lists > Items.
I don't get the error if I run the script as the Administrator role.
P.S. My code is
const searchObj = search.create({
type: search.Type.INVENTORY_DETAIL,
filters: [
search.createFilter({
name: 'internalid',
operator:
search.Operator.IS,
values: 1
})
],
columns: [
search.createColumn({
name: 'internalid',
join: search.Type.INVENTORY_NUMBER
})
]
});