AddOrUpdateChoices(Int32,String,String,Int32,Int32,Nullable<Boolean>,StepChoice[]) Method
- Last UpdatedNov 06, 2025
- 2 minute read
The AddOrUpdateChoices() method adds or updates job step choice records in the Job_Step_Choice table.
This overload of the method adds or updates one or more job step choice records.
'Declaration
Public Overloads Shared Sub AddOrUpdateChoices( _
ByVal sessionId As Integer, _
ByVal woId As String, _
ByVal operId As String, _
ByVal seqNo As Integer, _
ByVal stepNo As Integer, _
ByVal deleteAll As Nullable(Of Boolean), _
ByVal stepChoiceList() As StepChoice _
)
'Usage
Dim sessionId As Integer
Dim woId As String
Dim operId As String
Dim seqNo As Integer
Dim stepNo As Integer
Dim deleteAll As Nullable(Of Boolean)
Dim stepChoiceList() As StepChoice
JobStepChoice.AddOrUpdateChoices(sessionId, woId, operId, seqNo, stepNo, deleteAll, stepChoiceList)
public static void AddOrUpdateChoices(
int sessionId,
string woId,
string operId,
int seqNo,
int stepNo,
Nullable<bool> deleteAll,
StepChoice[] stepChoiceList
)
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 associated with the job.
- operId
- Required. Holds the ID of the operation associated with the job.
- seqNo
- Required. Holds the sequence number of the operation to which the job step belongs.
- stepNo
- Required. Holds the job step number.
- deleteAll
- Optional. Holds a flag that, if set to true, specifies that any job step choice records that match the supplied woId, operId, seqNo, and stepNo values, and the StepChoice objects, be deleted from the Job_Step_Choice table. This clears the specified choice records from the table before adding the new choice records.
- stepChoiceList
- Required. Holds an array of StepChoice objects, each containing the fields needed to create or update one step choice. Refer to the Remarks for more information.
Each element in the stepChoiceList array is an instance of the StepChoice class. The fields in this class are shown in the following table:
|
Field Name |
Description |
|---|---|
|
choiceNo |
Required. An integer that is the step choice number. |
|
choiceLabel |
Optional. A string that is the step choice label, which indicates the step choice type. |
This method adds or updates the row in the Job_Step_Choice table for each element in the stepChoiceList. If the choiceLabel is not supplied, the row identified by the choiceNo will be removed from the Job_Step_Choice table. If the choiceLabel is supplied and a row identified by the stepNo exists in the Job_Step_Choice table, the row is updated with the choiceLabel. If the choiceLabel is supplied and a row identified by the stepNo does not exist in the Job_Step_Choice table, a new row for the choiceNo and choiceLabel is created.