system.kanoa.inventory.updatePartCategory(partCategoryInfo, userId)
Updates an existing part category record. Pass a partCategoryInfo dictionary containing the partCategoryId of the category to update along with any of the editable fields
(category name, parent category, sort order, enabled flag), plus the userId of the user performing the change.
Unlike updatePartCategoryField, which updates a single named column, this function can update multiple fields on the category in one call.
Parameters
partCategoryInfo Dictionary
| - categoryName | String | |
| - enabled | Boolean | |
| - parentPartCategoryId | Integer | |
| - partCategoryId | Integer | |
| - sortOrder | Integer |
userId Integer:Id of the user executing the function
Returns
# of records modified Integer
message String None if success
Example
# Rename the "Filters" category and move it under a new parent category
partCategoryInfo = {
'partCategoryId': 42,
'categoryName': 'Filters - HVAC',
'parentPartCategoryId': 7,
'sortOrder': 3,
'enabled': True
}
userId = system.kanoa.security.getIDPUserId({'userName': 'SYSTEM'})
recordsModified, message = system.kanoa.inventory.updatePartCategory(partCategoryInfo, userId)
print recordsModified, message