Skip to main content

system.kanoa.asset.addState

Requires kanoaOPS license

Description

Add a state to the state table.

Syntax

addState(stateInfo, userId)

Parameters:
  • stateInfo (dict): Dictionary
  • userId (int): User ID.

  • Returns:
  • stateId (int): ID of the added state.
  • Dictionary

    ParameterTypeRequiredNotes
    stateNamestring
    stateColorNone
    stateCategoryIdint
    stateTypeIdint
    assetGroupIdNone
    enabledbool

    Code Examples

    # Example Usage:
    state_info = {
    'stateName': 'NewState',
    'stateCategoryId': 1,
    'stateTypeId': 1,
    'assetGroupId': 1,
    'enabled': True
    }
    user_id = 456
    state_id = system.kanoa.asset.addState(state_info, user_id)