ChangeSpecValues(Int32,String,Int32,String,String,String,String,Nullable<Boolean>,Nullable<Boolean>,Nullable<Int32>,String,String,Nullable<Int32>) Method
- Last UpdatedNov 06, 2025
- 3 minute read
The ChangeSpecValues() method changes a specific specification parameter’s value for the current running job and optionally the operation from which this job was created (if defined). This allows for runtime changing of spec values by users with appropriate privileges based on the job currently running on an entity.
This overload of the method uses the entity ID to identify the entity specified for the method.
'Declaration
Public Overloads Shared Sub ChangeSpecValues( _
ByVal sessionId As Integer, _
ByVal userId As String, _
ByVal entId As Integer, _
ByVal specId As String, _
ByVal newSpecValue As String, _
ByVal newMinValue As String, _
ByVal newMaxValue As String, _
ByVal updateTemplate As Nullable(Of Boolean), _
ByVal checkPrivs As Nullable(Of Boolean), _
ByVal bomPos As Nullable(Of Integer), _
ByVal bomVerId As String, _
ByVal comments As String, _
ByVal jobPos As Nullable(Of Integer) _
)
'Usage
Dim sessionId As Integer
Dim userId As String
Dim entId As Integer
Dim specId As String
Dim newSpecValue As String
Dim newMinValue As String
Dim newMaxValue As String
Dim updateTemplate As Nullable(Of Boolean)
Dim checkPrivs As Nullable(Of Boolean)
Dim bomPos As Nullable(Of Integer)
Dim bomVerId As String
Dim comments As String
Dim jobPos As Nullable(Of Integer)
JobExec.ChangeSpecValues(sessionId, userId, entId, specId, newSpecValue, newMinValue, newMaxValue, updateTemplate, checkPrivs, bomPos, bomVerId, comments, jobPos)
public static void ChangeSpecValues(
int sessionId,
string userId,
int entId,
string specId,
string newSpecValue,
string newMinValue,
string newMaxValue,
Nullable<bool> updateTemplate,
Nullable<bool> checkPrivs,
Nullable<int> bomPos,
string bomVerId,
string comments,
Nullable<int> jobPos
)
Parameters
- sessionId
- Required. The ID of the client session from which the request is being made.
- userId
- Required. The ID of the user who is making the change. This value is used to authorize whether this user is permitted to make such changes or not.
- entId
- Required. Holds the ID of the entity on which the current job is running. The current job is used to identify the correct row(s) to update in the Job_Spec, Oper_Ent_Spec or Bom_Item_Oper_Spec tables.
- specId
- Required. Holds the ID of the new spec that is replacing the existing spec.
- newSpecValue
- Optional. Holds the new spec value.
- newMinValue
- Optional. Holds the new minimum spec value.
- newMaxValue
- Optional. Holds the new maximum spec value.
- updateTemplate
- Optional. Holds a flag that, if set to true, specifies that the method also update the spec value in the Oper_Ent_Spec and Bom_Item_Oper_Spec tables. Default is false. The spec value in the Job_Spec table is always updated.
- checkPrivs
- Optional. Holds a a flag that, if set to true, specifies that the user’s privileges should be checked before executing this action. Default is false.
- bomPos
- Optional. Holds the BOM position. Default is 0.
- bomVerId
- Optional. Holds the BOM version ID.
- comments
- Optional. Holds comments describing the spec change. The comments will be included in the audit trail if this option is enabled.
- jobPos
- Optional. Holds the job position on the entity on which the job is to be run. Defaults to 0.
If checkPrivs is true, then privileges are checked for this user.
The method first checks to see if the user has the required privilege to edit specifications. This is determined by the “May Edit Specs” privilege. If new_min_value or new_max_value is specified, then it is also validated against “May Edit minimum/maximum specification limits”. The user’s access level is validated against the specifications. The user’s access level must be greater than or equal to the specification access level of the row that is being updated for the method to succeed.
If the user does have the required privilege, the method updates the Job_Spec table with the new value for the spec. If this spec_id is defined only once for this job (not repeated for different steps), then the method will update it regardless of which steps are running. If the same spec_id is defined for multiple steps in this job, then it will only update the new spec value parameter for currently running step(s).
If the updateTemplate optional parameter is true, then the method also searches both the Oper_Ent_Spec and Bom_Item_Oper_Spec tables for the same spec_id (and optional step_no values as defined above) for this process and operation. If these spec_value fields are found, they are updated. These updates will occur only for the preferred versions in the Oper_Ent_Spec and Bom_Item_Oper_Spec tables as defined in the Oper_Spec_Ver table.
No changes will be made if newSpecValue, newMinValue, and newMaxValue are null.