Skip to main content

system.kanoa.event.checkForDuplicateModeEvents(paramsDict, userId)

We should never have duplicate contiguous modeEvent entries that are the same mode, workorder, item, asset. This function runs periodically and removes any duplicates


Parameters

paramsDict Dictionary

- assetIdInteger
- assetPathString
- endDateDateTime
- startDateDateTime

userId Integer


Returns

# of records modified Integer


Example

userId = 5
startDate = system.date.parse("2025-01-01 00:00:00")
endDate = system.date.parse("2025-01-07 00:00:00")
retVal = system.kanoa.event.checkforDuplicateModeEvents({'assetId': 5, 'startDate': startDate, 'endDate': endDate}, userId)