Skip to main content

system.kanoa.schedule.addScheduleBlock

Description

Adds a schedule block.

Syntax

addScheduleBlock(scheduleBlockInfo, userId)

Parameters:
  • scheduleBlockInfo (dictionary): Dictionary containing information about the schedule block.
  • userId (int): ID of the user adding the schedule block.

  • Returns:
  • scheduleBlockId (int): ID of the added schedule block.
  • Dictionary

    ParameterTypeRequiredNotes
    scheduleBlockNamestrName of the schedule block
    assetIdintID of the asset associated with the schedule block
    itemIdintID of the item associated with the schedule block or None
    workOrderIdintID of the work order associated with the schedule block or None
    scheduledQtyintQuantity scheduled
    modeIdintID of the mode associated with the schedule block
    startDatedatetimeStart date of the schedule block
    endDatedatetimeEnd date of the schedule block
    notesstrAdditional notes for the schedule block
    rruleStrstrRecurrence rule string (e.g., 'FREQ=DAILY;INTERVAL=1')
    colorstrColor 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)