DownTimeForm
| 📊 Overview: 23 Properties | 1 Constructor | 20 Functions |
📝 Description
Form element references
🕐 Last updated: 2025-12-10T11:45:22.651Z
📑 Table of Contents
- 📋 Properties (23)
- 🏗️ Constructor
- ⚙️ Functions
- Regular Functions
- updateDayButtonStyles
- calculateWeekCommencing (1 param) →
$WeekStart : Date - getDateForDay (1 param) →
$Date : Date - loadMachines
- loadWeekDates
- loadCategories
- getCurrentDayNumber →
$DayNumber : Integer - requery (1 param)
- requeryReasons
- setDate (1 param)
- setDayOfWeek (1 param)
- setWeekCommencing (1 param)
- nextWeek
- previousWeek
- showUnidentifiedForWeek
- setCategory (1 param)
- toggleShowArchived
- assignReasonToSelected (2 params) →
$Success : Boolean - getMachineNumber (1 param) →
$MachineNumber : Integer - updateWeekDropdown
- Regular Functions
Properties
| Property | Type | Default | Description |
|---|---|---|---|
MondayButton | cs.FormObject | - | Monday day button |
TuesdayButton | cs.FormObject | - | Tuesday day button |
WednesdayButton | cs.FormObject | - | Wednesday day button |
ThursdayButton | cs.FormObject | - | Thursday day button |
FridayButton | cs.FormObject | - | Friday day button |
SaturdayButton | cs.FormObject | - | Saturday day button |
SundayButton | cs.FormObject | - | Sunday day button |
SelectedDate | Date | - | Currently selected date for filtering |
SelectedWeekCommencing | Date | - | Monday of the selected week |
SelectedMachine | Object | - | Selected machine object {Machine: Integer} |
SelectedCategory | Text | - | Selected downtime reason category |
ShowArchivedReasons | Boolean | - | Whether to show archived reasons |
CanAssignDowntime | Boolean | - | Permission to assign downtime reasons |
RealTimeSelection | cs.RealTimeSelection | - | Filtered downtime records |
DownReasonsSelection | cs.DownReasonsSelection | - | Filtered downtime reasons |
SelectedRealTimeEntity | cs.RealTimeEntity | - | Currently selected downtime record |
SelectedRealTimeEntities | cs.RealTimeSelection | - | Selected downtime records |
SelectedReasonEntity | cs.DownReasonsEntity | - | Currently selected reason |
CategoryCollection | Collection | - | List of all categories |
WeekCommencingCollection | Collection | - | List of week commencing dates |
MachineCollection | Collection | - | List of machine numbers |
WeekDropdownObject | Object | - | Week dropdown data object |
CategoryDropdownObject | Object | - | Category dropdown data object |
Constructor
constructor
[🏗️ constructor]
Class constructor
Initialize form element references
Functions
Regular Functions
updateDayButtonStyles
Function updateDayButtonStyles
Update day button font styles based on selected date
calculateWeekCommencing
Function calculateWeekCommencing($Date : Date) -> $WeekStart : Date
Calculate the Monday of the current week for a given date
Parameters:
| Name | Type | Optional | Description |
|---|---|---|---|
$Date | Date | - | - |
Returns: Date
getDateForDay
Function getDateForDay($DayNumber : Integer) -> $Date : Date
Calculate the date for a specific day of the week (1=Sunday, 2=Monday, etc.)
Parameters:
| Name | Type | Optional | Description |
|---|---|---|---|
$DayNumber | Integer | - | - |
Returns: Date
loadMachines
Function loadMachines
Load all machines that have RealTime records
loadWeekDates
Function loadWeekDates
Load all weeks from 2016 to current date
loadCategories
Function loadCategories
Load all downtime reason categories
getCurrentDayNumber
Function getCurrentDayNumber -> $DayNumber : Integer
Get the current day number (for button styling)
Returns: Integer
requery
Function requery($ShowWeekUnidentified : Boolean)
Main query method - queries RealTime records based on filters
Parameters:
| Name | Type | Optional | Description |
|---|---|---|---|
$ShowWeekUnidentified | Boolean | - | - |
requeryReasons
Function requeryReasons
Query down reasons based on selected category and archive filter
setDate
Function setDate($Date : Date)
Set the selected date and requery
Parameters:
| Name | Type | Optional | Description |
|---|---|---|---|
$Date | Date | - | - |
setDayOfWeek
Function setDayOfWeek($DayNumber : Integer)
Set the selected day by day number (1=Sunday, 2=Monday, etc.)
Parameters:
| Name | Type | Optional | Description |
|---|---|---|---|
$DayNumber | Integer | - | - |
setWeekCommencing
Function setWeekCommencing($WeekStart : Date)
Set the selected week commencing date
Parameters:
| Name | Type | Optional | Description |
|---|---|---|---|
$WeekStart | Date | - | - |
nextWeek
Function nextWeek
Go to next week
previousWeek
Function previousWeek
Go to previous week
showUnidentifiedForWeek
Function showUnidentifiedForWeek
Show all unidentified for the week
setCategory
Function setCategory($Category : Text)
Set the selected category
Parameters:
| Name | Type | Optional | Description |
|---|---|---|---|
$Category | Text | - | - |
toggleShowArchived
Function toggleShowArchived
Toggle show archived reasons
assignReasonToSelected
Function assignReasonToSelected($RealTimeSelection : cs.RealTimeSelection; $DownReasonID : Integer) -> $Success : Boolean
Assign a down reason to selected RealTime records
Parameters:
| Name | Type | Optional | Description |
|---|---|---|---|
$RealTimeSelection | cs.RealTimeSelection | - | - |
$DownReasonID | Integer | - | - |
Returns: Boolean
getMachineNumber
Function getMachineNumber($RealTimeEntity : cs.RealTimeEntity) -> $MachineNumber : Integer
Get the machine number for a RealTime entity
Parameters:
| Name | Type | Optional | Description |
|---|---|---|---|
$RealTimeEntity | cs.RealTimeEntity | - | - |
Returns: Integer
updateWeekDropdown
Function updateWeekDropdown
Update week dropdown object to reflect current selection
Generated from DownTimeForm.4dm