system.kanoa.schedule.addScheduleBlock
Description
Adds a schedule block.Syntax
addScheduleBlock(scheduleBlockInfo, userId)Parameters:
Returns:
Dictionary
Parameter | Type | Required | Notes |
---|---|---|---|
scheduleBlockName | str | Name of the schedule block | |
assetId | int | ID of the asset associated with the schedule block | |
itemId | int | ID of the item associated with the schedule block or None | |
workOrderId | int | ID of the work order associated with the schedule block or None | |
scheduledQty | int | Quantity scheduled | |
modeId | int | ID of the mode associated with the schedule block | |
startDate | datetime | Start date of the schedule block | |
endDate | datetime | End date of the schedule block | |
notes | str | Additional notes for the schedule block | |
rruleStr | str | Recurrence rule string (e.g., 'FREQ=DAILY;INTERVAL=1') | |
color | str | Color code for the schedule block |
Code Examples
# Example Usage:
schedule_info = {'scheduleBlockName': 'Maintenance', 'assetId': 1, 'itemId': None, 'workOrderId': None, 'scheduledQty': None, 'modeId': 3, 'startDate': ..., 'endDate': ..., 'notes': 'Maintenance notes', 'rruleStr': 'FREQ=DAILY;INTERVAL=1', 'color': 'FF0000'}
user_id = 123
schedule_block_id = system.kanoa.schedule.addScheduleBlock(schedule_info, user_id)