system.kanoa.schedule.addScheduleBlock(scheduleBlockInfo)
Adds a new scheduleBlock. All scheduleBlockInfo keys are required
Parameters
scheduleBlockInfo Dictionary
| - assetId | Integer | Id of the asset associated with the schedule block |
| - color | String | Color code for the schedule block |
| - endDate | DateTime | End date of the schedule block |
| - itemId | Integer | Id of the item associated with the schedule block or None |
| - modeId | Integer | Id of the mode associated with the schedule block |
| - notes | String | Additional notes for the schedule block |
| - rruleStr | String | Recurrence rule string (e.g., 'FREQ=DAILY;INTERVAL=1') |
| - scheduleBlockName | String | Name of the schedule block |
| - scheduledQty | Integer | Quantity to be scheduled |
| - startDate | DateTime | Start date of the schedule block |
| - workOrderId | Integer | Id 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)