GetProjectedShiftSchedules Method
- Last UpdatedMar 17, 2026
- 4 minute read
'Declaration
Public Shared Function GetProjectedShiftSchedules( _
ByVal entId As Nullable(Of Integer), _
ByVal startTime As Nullable(Of Date), _
ByVal daysAhead As Nullable(Of Integer) _
) As DataSet
'Usage
Dim entId As Nullable(Of Integer)
Dim startTime As Nullable(Of Date)
Dim daysAhead As Nullable(Of Integer)
Dim value As DataSet
value = Ent.GetProjectedShiftSchedules(entId, startTime, daysAhead)
public static DataSet GetProjectedShiftSchedules(
Nullable<int> entId,
Nullable<DateTime> startTime,
Nullable<int> daysAhead
)
Parameters
- entId
- Optional. Holds the ID of the entity whose projected shift schedule is being retrieved. If this parameter is null, then the projected schedules for all entities that can schedule shifts will be returned.
- startTime
- Optional. Holds the start date/time of the time period within which the retrieved shifts must fall.
- daysAhead
- Optional. Holds the number of days to add to the start date/time to define the time period within which the retrieved shifts must fall.
Return Value
Returns a Dataset that contains a list of projected shift schedules for the entities, within the defined time period (see Remarks below for more information about how the time period is determined). If no matching records are found, an empty DataSet is returned.
The columns of the returned DataSet are described below.
| Column Names | Description |
|---|---|
| ent_id | An integer that is the entity ID. |
| shift_start_local | A datetime that identifies the time the shift starts, in the local time of the entity. Based on start_time in the Shift_Schedule table. |
| shift_end_local | A datetime that identifies the time the shift ends, in the local time of the entity. Based on end_time in the Shift_Schedule table. |
| shift_id | An integer that is a unique shift identifier. From the Shift_Schedule table. |
| break1_start | A datetime that identifies the time the 1st break starts; the day, hour, and minute is returned but not seconds. From the Shift_Schedule table. |
| break1_end | A datetime that identifies the time that the 1st break ends; the day, hour, and minute is returned but not seconds. From the Shift_Schedule table. |
| break2_start | A datetime that identifies the time that the 2nd break starts; the day, hour, and minute is returned but not seconds. From the Shift_Schedule table. |
| break2_end | A datetime that identifies the time that the 2nd break ends; the day, hour, and minute is returned but not seconds. From the Shift_Schedule table. |
| break3_start | A datetime that identifies the time that the 3rd break starts; the day, hour, and minute is returned but not seconds. From the Shift_Schedule table. |
| break3_end | A datetime that identifies the time that the 3rd break ends; the day, hour, and minute is returned but not seconds. From the Shift_Schedule table. |
| shift_start_utc | A datetime that identifies the time the shift starts, in UTC. Based on start_time in the Shift_Schedule table. |
| shift_end_utc | A datetime that identifies the time the shift ends, in UTC. Based on end_time in the Shift_Schedule table. |
| shift_sched_ent_id | An integer that is the ID of the entity or parent entity that generated this shift. |
| pattern_id | An integer that is the ID of the shift pattern that generated this shift. From the Shift_Schedule table. |
| ent_tz_id | A string that is the time zone ID of the entity. Via links from the Ent, then Site table. |
| context | A string that indicates the context of how this shift was generated. For internal use only. |
| shift_type |
An integer that is an enumeration that indicates the type of shift: 1 = Holiday 2 = Overtime 3 = Regular 4 = No Shift |
The end date for the shifts to be retrieved is determined based on the supplied start date and days ahead parameters.
If a value for the supplied daysAhead parameter is:
- Between 1 and 365, that value is used to determine the end date
- Greater than 365, then the value defaults to 365 days
- Less than 1, then the value defaults to 7
- Null or not supplied, then the value defaults to 7
Thus, the end date of the time period is obtained by adding the days ahead number to the start date.
If the specified entity is not capable of scheduling shifts, then the shift schedules of the first ancestor entity that can schedule shifts are returned.
If a null value is supplied for the entity parameter, then shift schedules from all the entities that can schedule shifts are included in the DataSet. These shift schedules are defined in standard times for each day of the week, and they do not represent the actual day the shift belongs to an entity. When this method is called, these shift templates are used as a baseline to create projected shift schedules for the specified number of days. If shift exceptions are configured for an entity, then those exceptions are accounted in the projected shift schedule.
Note that the DataSet returned by this method only represents the projected shift schedule, which might or might not exist for an entity.
For input parameters that are not to be included as a filter, pass a null.