Skip to main content

system.kanoa.inventory.updatePartInventoryPolicyField(partInventoryPolicyId, field, value, userId)

Updates a single named field on an existing part inventory policy record identified by partInventoryPolicyId. The policy governs stocking behavior for a part at an inventory asset (bin/location) � quantities such as min/max, reorder point, reorder quantity, safety stock, count frequency, and the stocked flag. The change is attributed to the user identified by userId for audit-trail purposes.


Parameters

partInventoryPolicyId Integer: Id of part inventory policy to update
field String: Valid options are partId, inventoryAssetId, minQty, maxQty, reorderPointQty, reorderQty, safetyStockQty, countFrequencyDays, isStocked
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

partInventoryPolicyId = 77
field = 'reorderPointQty'
value = 25
userId = system.kanoa.security.getIDPUserId({'userName': 'SYSTEM'})

recordsModified, message = system.kanoa.inventory.updatePartInventoryPolicyField(partInventoryPolicyId, field, value, userId)
print recordsModified, message