Skip to main content

system.kanoa.lot.unlinkAssetLotState

Description

Checks if a lot state reason has been stored in the stateEvent table and disables it if found; otherwise, deletes it.

Syntax

unlinkAssetLotState(lotStateReasonAssetLinkId, userId)

Parameters:
  • lotStateReasonAssetLinkId (int) - Lot state reason asset link ID
  • userId (int) - User ID

  • Returns:
  • numRecordsModified (int) - Number of records modified
  • message (string) - Message indicating whether the link was deleted or disabled
  • Code Examples

    # Example usage
    lotStateReasonAssetLinkId = 1
    userId = 123
    recordsModified, msg = system.kanoa.lot.unlinkAssetLotState(lotStateReasonAssetLinkId, userId)
    print(recordsModified) # Print the number of records modified
    print(msg) # Print the message indicating whether the link was deleted or disabled