Skip to main content

system.kanoa.schedule.addScheduleBlock(scheduleBlockInfo)

Adds a new scheduleBlock. All scheduleBlockInfo keys are required


Parameters

scheduleBlockInfo Dictionary

- assetIdIntegerId of the asset associated with the schedule block
- colorStringColor code for the schedule block
- endDateDateTimeEnd date of the schedule block
- itemIdIntegerId of the item associated with the schedule block or None
- modeIdIntegerId of the mode associated with the schedule block
- notesStringAdditional notes for the schedule block
- rruleStrStringRecurrence rule string (e.g., 'FREQ=DAILY;INTERVAL=1')
- scheduleBlockNameStringName of the schedule block
- scheduledQtyIntegerQuantity to be scheduled
- startDateDateTimeStart date of the schedule block
- workOrderIdIntegerId of the work order associated with the schedule block or None

Returns

scheduleBlockId Integer


Example

scheduleBlockInfo = {
'scheduleBlockName': 'Maintenance',
'assetId': 1,
'itemId': None,
'workOrderId': None,
'scheduledQty': None,
'modeId': 3,
'startDate': system.date.parse('2025-11-05 06:00:00'),
'endDate': system.date.parse('2025-11-05 09:00:00'),
'notes': 'Maintenance notes',
'rruleStr': 'FREQ=DAILY;INTERVAL=1',
'color': 'FF0000'
}
userId = 123
scheduleBlockId = system.kanoa.schedule.addScheduleBlock(scheduleBlockInfo, userId)