GetCurrentAndPreviousShift Method
- Last UpdatedNov 06, 2025
- 2 minute read
The GetCurrentAndPreviousShift() method returns a dataset containing the current and previous shift for the specified entity. If there is no current shift (shift 0 only), then only the previous shift information will be returned. The current shift can be distinguished from the previous shift by virtue of having no end time.
'Declaration
Public Shared Function GetCurrentAndPreviousShift( _
ByVal entityId As Integer _
) As DataSet
'Usage
Dim entityId As Integer
Dim value As DataSet
value = ShiftHistory.GetCurrentAndPreviousShift(entityId)
Parameters
- entityId
- Required. The ID of the entity whose current and previous shift is being requested.
Return Value
Returns a DataSet that contains records for the specified entity. 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 ID of the entity. |
| ent_name | A string that is the entity name. |
| shift_id | An integer that is the shift ID. |
| shift_desc | A string that is the shift description. |
| shift_start_utc | A datetime that indicates when the shift started, in UTC. |
| shift_start_local | A datetime that indicates when the shift started, in the local time of the entity. |
| shift_start | A datetime that indicates when the shift started, in the local time of the client application that is making the call. |
| shift_end_utc | A datetime that indicates when the shift ended, in UTC. For a previous shift, there will always be a datetime value. For the current shift, this will always be null. |
| shift_end_local | A datetime that indicates when the shift ended, in the local time of the entity. For a previous shift, there will always be a datetime value. For the current shift, this will always be null. |
| shift_end | A datetime that indicates when the shift ended, in the local time of the client application that is making the call. For a previous shift, there will always be a datetime value. For the current shift, this will always be null. |