Skip to main content

system.kanoa.inventory.updatePartField(partId, field, value, userId)

Updates a single named field on a part record for the given partId, without needing to supply the full part dictionary. Useful for quick, targeted edits � such as flipping a handling flag or correcting a manufacturer part number � from a UI control bound to one column at a time.


Parameters

partId Integer: Id of part to update
field String: Valid options are partNumber, partDescription, partCategory, manufacturerId, manufacturerPartNumber, defaultUomId, isCriticalSpare, isRepairable, isSerialized, isConsumable, isActive, notes
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

# Mark an existing gasket part as a critical spare
partId = 5187
field = 'isCriticalSpare'
value = True
userId = system.kanoa.security.getIDPUserId({'userName': 'SYSTEM'})

recordsModified, message = system.kanoa.inventory.updatePartField(partId, field, value, userId)
print recordsModified, message