Skip to main content

system.kanoa.inventory.updateInventoryTransactionTypeField(inventoryTransactionTypeId, field, value, userId)

Updates a single named field on an inventory transaction type record identified by inventoryTransactionTypeId. This is a targeted, single-column alternative to updateInventoryTransactionType, useful when only one attribute (the transaction type's code, name, or quantity sign) needs to change. The update is attributed to the user specified by userId.


Parameters

inventoryTransactionTypeId Integer: Id of inventory transaction type to update
field String: Valid options are inventoryTransactionTypeId, transactionTypeCode, transactionTypeName, quantitySign
value String: Value to update to
userId Integer:Id of the user executing the function


Returns

# of records modified Integer
message String None if success


Example

inventoryTransactionTypeId = 4
fieldName = 'transactionTypeName'
fieldValue = 'Cycle Count Adjustment'
userId = system.kanoa.security.getIDPUserId({'userName': 'SYSTEM'})
recordsModified, message = system.kanoa.inventory.updateInventoryTransactionTypeField(inventoryTransactionTypeId, fieldName, fieldValue, userId)
print recordsModified, message