Skip to main content

system.kanoa.schedule.addScheduleBlock

This function requires KanoaOPS module

Description

Adds a schedule block.

Syntax

addScheduleBlock(scheduleBlockInfo, userId)
  • Parameters
      scheduleBlockInfo (Dictionary) - Dictionary containing information about the schedule block.
            'scheduleBlockName' (str): Name of the schedule block
            'assetId' (int): ID of the asset associated with the schedule block
            'itemId' (int or None): ID of the item associated with the schedule block
            'workOrderId' (int or None): ID of the work order associated with the schedule block
            'scheduledQty' (int or None): Quantity scheduled
            'modeId' (int): ID of the mode associated with the schedule block
            'startDate' (date): Start date of the schedule block
            'endDate' (date): End date of the schedule block
            'notes' (str or None): Additional notes for the schedule block
            'rruleStr' (str): Recurrence rule string (e.g., 'FREQ=DAILY;INTERVAL=1')
            'color' (str or None): Color code for the schedule block
        userId (int) - User ID.
    • Returns
        scheduleBlockId (int) - ID of the added schedule block.
    • Code Example

      # Example Usage:
      schedule_info = {'scheduleBlockName': 'Maintenance', 'assetId': 1, 'itemId': None, 'workOrderId': None, 'scheduledQty': None, 'modeId': 3, 'startDate': ..., 'endDate': ..., 'notes': 'Maintenance notes', 'rruleStr': '...', 'color': 'FF0000'}
      user_id = 123
      schedule_block_id = system.kanoa.schedule.addScheduleBlock(schedule_info, user_id)