Skip to main content

system.kanoa.event.clearZeroedCountEvents(assetId, tStamp, userId)

We added a zero at the beginning of a run to prevent calculated counts from occurring, but now the run has ended or a shift change has occurred. We will see if the last entry is a zero and if so remove it, so that the count will be calculated. If this is a shift change we will delete the zero count and then add the zero count for the next shift


Parameters

assetId Integer: Id of asset
tStamp DateTime: Timestamp of counter event to delete
userId Integer


Returns

# of records deleted Integer


Example

assetId = 123
tStamp = system.date.now()
userId = 999
recordsDeleted = system.kanoa.event.clearZeroedCountEvents(assetId, tStamp, userId)