Skip to main content

system.kanoa.lot.enableLotOperationAssetLink

Requires kanoaOPS license

Description

Updates the enabled state of a lot-operation-to-asset link record.

Syntax

enableLotOperationAssetLink(lotOperationAssetLinkId, enabled)

Parameters:

– lotOperationAssetLinkId (int): The ID of the link record to update.
– enabled (bool): The desired state of the link (True to enable, False to disable).

Returns:

– recordsModified (int): Number of records updated (typically 1).

Behavior

The function updates the enabled flag for the specified lotOperationAssetLinkId in the mes.lotOperationAssetLink table.

– If the ID exists, the enabled column is set to the provided value.
– Returns the number of affected rows to confirm the update.

Parameters

ParameterTypeRequiredNotes
lotOperationAssetLinkIdintYesID of the lot-operation-to-asset link record to update
enabledboolYesTrue to enable the link, False to disable it

Code Examples

# Enable a link
recordsModified = system.kanoa.lot.enableLotOperationAssetLink(
lotOperationAssetLinkId=305,
enabled=True
)
print(recordsModified) # e.g., 1

# Disable a link
recordsModified = system.kanoa.lot.enableLotOperationAssetLink(
lotOperationAssetLinkId=305,
enabled=False
)
print(recordsModified)