USER_ERROR USER_ERROR("You cannot create an inventory detail for this item."); even though the item is inventory
var inventoryDetailSubrecord = currRec.getCurrentSublistSubrecord({
sublistId: 'item',
fieldId: 'inventorydetail'
});
inventoryDetailSubrecord.selectNewLine({ sublistId: 'inventoryassignment' });
inventoryDetailSubrecord.setCurrentSublistValue({ sublistId: 'inventoryassignment', fieldId: 'issueinventorynumber', value: promoLot });
inventoryDetailSubrecord.setCurrentSublistValue({ sublistId: 'inventoryassignment', fieldId: 'quantity', value: calcPromo });
inventoryDetailSubrecord.commitLine({ sublistId: 'inventoryassignment' });
inventoryDetailSubrecord.commit();