Skip to main content

system.kanoa.lot.executeLotOperation(lotOperationInfo, inputLotEvents, outputLotEvents, userId)

Creates or updates a lot operation event with input and output lot events


Parameters

lotOperationInfo Dictionary

- assetIdIntegerasset the operation is performed on
- enabledBoolean
- lotOperationEventIdIntegerSet to None for a new lot operation or use an existing operation event
- lotOperationIdInteger
- tStampDateTime

inputLotEvents List of Dictionaries: list of input lotEventInfo dictionaries to be consumed by this operation. All keys are required unless stated.

- assetIdInteger
- commentStringNot required
- itemIdIntegerRequired if this is a new lot
- itemUnitIdInteger
- lotEventQtyFloat
- lotIdIntegerEither lotId or lotName must be provided
- lotNameStringEither lotId or lotName must be provided
- lotStateIdInteger
- lotStateReasonIdIntegerNot required
- shiftIdIntegerNot required
- tStampDateTime
- workOrderIdIntegerNot required

outputLotEvents List of Dictionaries: list of output lotEventInfo dictionaries that are to be created by this operation

- assetIdInteger
- commentStringNot required
- itemIdIntegerRequired if this is a new lot
- itemUnitIdInteger
- lotEventQtyFloat
- lotIdIntegerEither lotId or lotName must be provided
- lotNameStringEither lotId or lotName must be provided
- lotStateIdInteger
- lotStateReasonIdIntegerNot required
- shiftIdIntegerNot required
- tStampDateTime
- workOrderIdIntegerNot required

userId Integer


Returns

lotOperationEventId Integer
message String None if success


Example


>lotOperationEventInfo = {
'lotOperationEventId': None,
lotOperationId': 1,
'assetId': 5,
'tStamp': system.date.now(),
'enabled': True
}
>inputLotEvents = []
>outputLotEvents = [{
lotEventId': None,
'lotId': 1,
'lotEventQty': 100,
'workOrderId': 56,
'assetId':1,
'itemSourceId': 2,
'lotStateId': 7,
'lotStateReasonId': 78,
'shiftId': 4,
'tStamp': system.date.now,
'comment':None,
'lotOperationEventId': None
}]
>lotOperationEventId, msg = system.kanoa.lot.executeLotOperation(lotOperationEventInfo, inputLotEvents, outputLotEvents, userId)