SetStatus Method
- Last UpdatedNov 06, 2025
- 1 minute read
The SetStatus() method changes the status of a work order by adjusting the states of one or more of the work order's underlying jobs. Note that, in some cases, the new status of the work order may not match the requested status.
'Declaration
Public Shared Function SetStatus( _
ByVal sessionId As Integer, _
ByVal woId As String, _
ByVal requestedStatus As WorkOrderStatus, _
ByVal userId As String, _
ByVal eventTimeLocal As Nullable(Of Date) _
) As Integer
'Usage
Dim sessionId As Integer
Dim woId As String
Dim requestedStatus As WorkOrderStatus
Dim userId As String
Dim eventTimeLocal As Nullable(Of Date)
Dim value As Integer
value = WO.SetStatus(sessionId, woId, requestedStatus, userId, eventTimeLocal)
public static int SetStatus(
int sessionId,
string woId,
WorkOrderStatus requestedStatus,
string userId,
Nullable<DateTime> eventTimeLocal
)
Parameters
- sessionId
- Required. Holds the session ID and thus the user who is making this method call.
- woId
- Required. Holds the ID of the work order.
- requestedStatus
- Required. The desired new status for the work order.
- userId
- Optional. Holds the ID of the user.
- eventTimeLocal
- Optional. Holds the time of the status change event, in the client's local time.
Return Value
This method returns an integer which represents the actual status of the work order, once its status has been changed. Returns 0 if the call fails.