StartDataEntryJob(Int32,String,String,String,String,String,String,Double,Nullable<Int32>,Nullable<Int32>,DBString,DBString,DBString,DBString,Int32) Method
- Last UpdatedNov 06, 2025
- 4 minute read
The StartDataEntryJob() method creates and starts a new data entry job on the fly.
This overload of the method uses the entity name and site name to specify the entity.
'Declaration
Public Overloads Shared Sub StartDataEntryJob( _
ByVal sessionId As Integer, _
ByVal userId As String, _
ByVal entName As String, _
ByVal siteName As String, _
ByVal woId As String, _
ByVal operId As String, _
ByVal itemId As String, _
ByVal estProdRate As Double, _
ByVal prodUom As Nullable(Of Integer), _
ByVal uomId As Nullable(Of Integer), _
ByVal spare1 As DBString, _
ByVal spare2 As DBString, _
ByVal spare3 As DBString, _
ByVal spare4 As DBString, _
ByRef seqNo As Integer _
)
'Usage
Dim sessionId As Integer
Dim userId As String
Dim entName As String
Dim siteName As String
Dim woId As String
Dim operId As String
Dim itemId As String
Dim estProdRate As Double
Dim prodUom As Nullable(Of Integer)
Dim uomId As Nullable(Of Integer)
Dim spare1 As DBString
Dim spare2 As DBString
Dim spare3 As DBString
Dim spare4 As DBString
Dim seqNo As Integer
JobExec.StartDataEntryJob(sessionId, userId, entName, siteName, woId, operId, itemId, estProdRate, prodUom, uomId, spare1, spare2, spare3, spare4, seqNo)
public static void StartDataEntryJob(
int sessionId,
string userId,
string entName,
string siteName,
string woId,
string operId,
string itemId,
double estProdRate,
Nullable<int> prodUom,
Nullable<int> uomId,
DBString spare1,
DBString spare2,
DBString spare3,
DBString spare4,
out int seqNo
)
Parameters
- sessionId
- Required. Holds the ID of the session from which the job is being started.
- userId
- Required. Holds the ID of the user who is starting the job.
- entName
- Required. Holds the name of the entity where the job is to be run.
- siteName
- Optional. Holds the site name for this entity.
- woId
- Required. Holds the ID of the work order.
- operId
- Required. Holds the ID of the operation.
- itemId
- Required. Holds the ID of the item.
- estProdRate
- Required. Holds the estimated production rate.
- prodUom
- Optional. Holds the production unit of measure (UOM).
- uomId
- Optional. Holds the ID of the UOM. Default is null.
- spare1
- Optional. Holds the contents of the user-defined spare1 field.
- spare2
- Optional. Holds the contents of the user-defined spare2 field.
- spare3
- Optional. Holds the contents of the user-defined spare3 field.
- spare4
- Optional. Holds the contents of the user-defined spare4 field.
- seqNo
- Optional. Holds the job sequence number.
The woId, operId, itemId, and entId are all required to identify the job to be started on the specified entity. The sessionId is required for licensing checks. The userId is used for checking the privileges.
For this method to succeed, the following must be true:
- The supplied entity can run jobs, which must be true for the method to succeed.
- At least one item class in the Item_Class table has its produced column set to true.
- If the supplied item matches an existing item in the Item table, the supplied uom_id matches the corresponding uom_id column in the Item table.
- If the supplied work order exists, its state is not Closed.
- If the job exists, the supplied item matches the existing job's item.
- The supplied entity or one of its ancestor entities are able to schedule jobs.
The method checks if the supplied item exists in the database. If not, a new item is created on the fly with default values under the first item_class found in the Item_Class table for which produced is set to 1 (true).
The method then checks to see if the supplied work order exists in the database. If not, a new work order is created with its default values.
Next, the method checks whether the supplied job exists in the database and the supplied entity matches with the run_ent_id field in the Job table. If the job exists and the supplied est_prod_rate does not match the existing est_prod_rate column in the job's record in the Job table, the record is updated with the supplied est_prod_rate.
If the job does not exist, a new job record is created with its default values. If the supplied entity can schedule jobs, the init_sched_ent_id and target_sched_ent_id values are populated with the supplied ent_id value. Otherwise, the first preferred ancestor entity found that can schedule jobs is assigned to the init_sched_ent_id and target_sched_ent_id fields. The run_ent_id field is populated with the supplied ent_id value. The seq_no and the display_seq_no are the next highest numbers of the supplied work order.
If a job is currently running on job position 0 of the supplied entity and it differs from the supplied wo_id and oper_id, the job is ended and the data entry job is started. If a job is currently running on job position 0 of the supplied entity and it has the same wo_id and oper_id as the data entry job, the job is left running.