Skip to main content

system.kanoa.asset.updateStateField(stateId, field, value, userId)

Updates the passed field value for the given stateId. If the field is enabled, we will also update the assetLink table enabled bit


Parameters

stateId Integer: Id of the state to update
field String: name of the field to update. Valid options are stateName, stateColor, stateCategoryId, stateTypeId, assetGroupId, enabled
value pyObject: Value to update to
userId Integer: Id of user executing the function


Returns

# of records modified Integer


Example

stateId = 45
field = 'stateName'
value = 'Really Blocked'
userId = 5
modifiedRecords = system.kanoa.asset.updateStateField(stateId, field, value, userId)