Skip to main content

system.kanoa.inventory.updateCostCenter(costCenterInfo, userId)

Updates an existing cost center record in the Kanoa MES inventory module. The record to update, along with the field values to apply, is passed as the costCenterInfo dictionary (it must include the costCenterId of the record being updated), and userId records who performed the change for audit purposes. Use updateCostCenterField instead if only a single column needs to change.


Parameters

costCenterInfo Dictionary

- costCenterCodeString
- costCenterIdInteger
- costCenterNameString

userId Integer:Id of the user executing the function


Returns

# of records modified Integer
message String None if success


Example

costCenterInfo = {
'costCenterId": 14,
'costCenterCode': "CC205",
'costCenterName': "Packaging"
}

userId = system.kanoa.security.getIDPUserId({'userName': 'SYSTEM'})
recordsModified, message = system.kanoa.inventory.updateCostCenter(costCenterInfo, userId)
print recordsModified, message