system.kanoa.inventory.addPartCategory(partCategoryInfo, userId)
Adds a new part category, used to classify inventory parts (e.g. Bearings, Filters, Gaskets) for filtering and reporting.
Categories can be nested under a parent category via parentPartCategoryId, and sortOrder controls their display order within pickers and reports.
Parameters
partCategoryInfo Dictionary
| - categoryName | String | |
| - enabled | Boolean | |
| - parentPartCategoryId | Integer | |
| - sortOrder | Integer |
userId Integer:Id of the user executing the function
Returns
partCategoryId Integer
message String None if success
Example
# Add a new top-level "Bearings" part category
partCategoryInfo = {
'categoryName': 'Bearings',
'enabled': True,
'parentPartCategoryId': None,
'sortOrder': 10
}
userId = system.kanoa.security.getIDPUserId({'userName': 'SYSTEM'})
partCategoryId, message = system.kanoa.inventory.addPartCategory(partCategoryInfo, userId)
print partCategoryId, message