Skip to main content

system.kanoa.schedule.updateScheduleBlock

This function requires KanoaOPS module

Description

Updates a schedule block.

Syntax

updateScheduleBlock(scheduleBlockInfo, userId)
  • Parameters
      scheduleBlockInfo (Dictionary) - Dictionary containing information about the schedule block.
          - scheduleBlockId (int): Id of the schedule block
          - 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
          userId (int) - User ID.
  • Returns
      # of records modified.
  • Code Example

    # Example Usage:
    updated_schedule_info = {'scheduleBlockId': 456, 'scheduleBlockName': 'Updated Maintenance', 'assetId': 2, 'itemId': None, 'workOrderId': None, 'scheduledQty': None, 'modeId': 4, 'startDate': ..., 'endDate': ..., 'notes': 'Updated Maintenance notes', 'rruleStr': '...', 'color': '00FF00'}
    user_id = 123
    records_modified = system.kanoa.schedule.updateScheduleBlock(updated_schedule_info, user_id)