ChangeSpecValue(Int32,String,String,String,String,String,Boolean,Nullable<Int32>,String,String,Nullable<Int32>) Method
- Last UpdatedNov 06, 2025
- 3 minute read
The ChangeSpecValue() 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 name and site name to identify the entity specified for the method.
'Declaration
Public Overloads Shared Sub ChangeSpecValue( _
ByVal sessionId As Integer, _
ByVal userId As String, _
ByVal entName As String, _
ByVal siteName As String, _
ByVal specId As String, _
ByVal newSpecValue As String, _
ByVal updateTemplate As 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 entName As String
Dim siteName As String
Dim specId As String
Dim newSpecValue As String
Dim updateTemplate As Boolean
Dim bomPos As Nullable(Of Integer)
Dim bomVerId As String
Dim comments As String
Dim jobPos As Nullable(Of Integer)
JobExec.ChangeSpecValue(sessionId, userId, entName, siteName, specId, newSpecValue, updateTemplate, bomPos, bomVerId, comments, jobPos)
public static void ChangeSpecValue(
int sessionId,
string userId,
string entName,
string siteName,
string specId,
string newSpecValue,
bool updateTemplate,
Nullable<int> bomPos,
string bomVerId,
string comments,
Nullable<int> jobPos
)
Parameters
- sessionId
- Required. Holds the ID of the client session from which the request is being made.
- userId
- Optional. Holds the ID of the user making the change. This value is used to authorize whether this user is permitted to make such changes or not.
- entName
- Required. Holds the name of the entity where 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.
- siteName
- Optional. Holds the site name of the entity.
- specId
- Required. Holds the ID of the new spec that is replacing the existing spec.
- newSpecValue
- Required. Holds the new 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. The spec value in the Job_Spec table is always updated.
- bomPos
- Optional. Holds the BOM position.
- 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.
The method first checks to see if the user has the required privilege to edit specifications. Then it checks whether any job is running on the supplied entity and job position. The method also checks to see if any job spec exists for this job.
The Job_Spec table is updated 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 code 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 the process and operation from which the job was instantiated. 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.