Skip to main content

system.kanoa.schedule.getScheduleBlocks

Description

Returns all schedule blocks for the given parameters.

Syntax

getScheduleBlocks(paramsDict)

Parameters:
  • paramsDict (dict): Dictionary of filters to apply when retrieving schedule blocks.

  • Returns:
  • scheduleBlocks (pyDataset): Dataset containing schedule blocks based on the provided parameters.
  • Dictionary

    ParameterTypeRequiredNotes
    assetIdintID of the asset
    assetPathstringPath of the asset
    recurringboolWhether the schedule block is recurring
    scheduleBlockIdintID of the schedule block
    scheduleBlockIdListlist[int]List of schedule block IDs
    modeIdintID of the mode
    modeNamestringName of the mode
    workOrderIdintID of the work order
    workOrderNamestringName of the work order
    itemIdintID of the item
    itemNamestringName of the item
    startDatedatetimeStart date of the schedule range
    endDatedatetimeEnd date of the schedule range

    Code Examples

    # Example Usage:
    paramsDict = {'scheduleBlockId': 217}
    print system.kanoa.utilities.convertDatasetRowToJSON(system.kanoa.schedule.getScheduleBlocks(paramsDict), 0)
    > {
    'modeName': u'Production',
    'itemColor': u'#000000',
    'notes': u'',
    'color': u'#00FF00',
    'scheduleBlockId': 217,
    'scheduledQty': None,
    'endDate': Mon Aug 14 00:30:00 UTC 2023,
    'modeTypeId': 5,
    'changedDate': None,
    'itemName': u'Product A1',
    'modeId': 2,
    'assetId': 451,
    'assetPath': None,
    'changedBy': None,
    'itemDescription': u'Nice buns',
    'outfeedUnits': None,
    'modeTypeName': u'Production',
    'itemId': 45,
    'modeColor': u'#00639a',
    'createdDate': None,
    'itemPath': u'FG\\WINE\\RED WINE\\Product A1',
    'createdBy': None,
    'rruleStr': u'FREQ=WEEKLY;INTERVAL=1;BYWEEKDAY=MO,TU,WE,TH,FR;UNTIL=20230816T020000',
    'workOrderName': u'1234b',
    'workOrderId': 1,
    'scheduleBlockName': u'',
    'startDate': Sun Aug 13 16:30:00 UTC 2023
    }
    >>>