Skip to main content

system.kanoa.inventory.addPartInventoryPolicy(partInventoryPolicyInfo, userId)

Adds a new part inventory policy record, defining the stocking and reorder rules for a part at a given inventory location. A policy specifies whether the part is actively stocked, the min/max/safety-stock quantity thresholds, the reorder point and reorder quantity, and how often the part should be cycle-counted. Pass a dictionary of policy field values and the id of the user creating the record.


Parameters

partInventoryPolicyInfo Dictionary

- countFrequencyDaysInteger
- inventoryAssetIdInteger
- isStockedBoolean
- maxQtyFloat
- minQtyFloat
- partIdInteger
- reorderPointQtyFloat
- reorderQtyFloat
- safetyStockQtyFloat

userId Integer:Id of the user executing the function


Returns

partInventoryPolicyId Integer
message String None if success


Example

partInventoryPolicyInfo = {
'partId': 8890,
'inventoryAssetId': 12,
'isStocked': True,
'minQty': 25.0,
'maxQty': 200.0,
'safetyStockQty': 15.0,
'reorderPointQty': 40.0,
'reorderQty': 100.0,
'countFrequencyDays': 30
}
userId = system.kanoa.security.getIDPUserId({'userName': 'SYSTEM'})
partInventoryPolicyId, message = system.kanoa.inventory.addPartInventoryPolicy(partInventoryPolicyInfo, userId)
print partInventoryPolicyId, message