Add Method (Sample)
- Last UpdatedNov 06, 2025
- 4 minute read
The Add() method adds a new Sample record to the Sample table.
'Declaration
Public Shared Sub Add( _
ByVal sessionId As Integer, _
ByVal entId As Integer, _
ByVal sampleName As DBString, _
ByVal itemId As DBString, _
ByVal woId As DBString, _
ByVal operId As DBString, _
ByVal seqNo As DBInt, _
ByVal contextEntId As DBInt, _
ByVal contextItemId As DBString, _
ByVal itemCategoryId As DBInt, _
ByVal processId As DBString, _
ByVal contextOperId As DBString, _
ByVal freqId As DBInt, _
ByVal segmentRequirementId As DBString, _
ByVal segmentResponseId As DBString, _
ByVal lotNo As DBString, _
ByVal subLotNo As DBString, _
ByVal requestedTimeLocal As Date, _
ByVal expiryTimeLocal As DBDateTime, _
ByVal warningTimeLocal As DBDateTime, _
ByVal pulledBy As DBString, _
ByVal pulledTimeLocal As DBDateTime, _
ByVal final As Nullable(Of Boolean), _
ByVal finalizedBy As DBString, _
ByVal finalizedAtLocal As DBDateTime, _
ByVal verifiedBy As DBString, _
ByVal sampleStatus As Integer, _
ByVal sampleResult As DBInt, _
ByVal spare1 As DBString, _
ByVal spare2 As DBString, _
ByVal spare3 As DBString, _
ByVal spare4 As DBString, _
ByVal lastEditComment As DBString, _
ByRef sampleId As Integer, _
ByRef lastEditAt As Date _
)
'Usage
Dim sessionId As Integer
Dim entId As Integer
Dim sampleName As DBString
Dim itemId As DBString
Dim woId As DBString
Dim operId As DBString
Dim seqNo As DBInt
Dim contextEntId As DBInt
Dim contextItemId As DBString
Dim itemCategoryId As DBInt
Dim processId As DBString
Dim contextOperId As DBString
Dim freqId As DBInt
Dim segmentRequirementId As DBString
Dim segmentResponseId As DBString
Dim lotNo As DBString
Dim subLotNo As DBString
Dim requestedTimeLocal As Date
Dim expiryTimeLocal As DBDateTime
Dim warningTimeLocal As DBDateTime
Dim pulledBy As DBString
Dim pulledTimeLocal As DBDateTime
Dim final As Nullable(Of Boolean)
Dim finalizedBy As DBString
Dim finalizedAtLocal As DBDateTime
Dim verifiedBy As DBString
Dim sampleStatus As Integer
Dim sampleResult As DBInt
Dim spare1 As DBString
Dim spare2 As DBString
Dim spare3 As DBString
Dim spare4 As DBString
Dim lastEditComment As DBString
Dim sampleId As Integer
Dim lastEditAt As Date
Sample.Add(sessionId, entId, sampleName, itemId, woId, operId, seqNo, contextEntId, contextItemId, itemCategoryId, processId, contextOperId, freqId, segmentRequirementId, segmentResponseId, lotNo, subLotNo, requestedTimeLocal, expiryTimeLocal, warningTimeLocal, pulledBy, pulledTimeLocal, final, finalizedBy, finalizedAtLocal, verifiedBy, sampleStatus, sampleResult, spare1, spare2, spare3, spare4, lastEditComment, sampleId, lastEditAt)
public static void Add(
int sessionId,
int entId,
DBString sampleName,
DBString itemId,
DBString woId,
DBString operId,
DBInt seqNo,
DBInt contextEntId,
DBString contextItemId,
DBInt itemCategoryId,
DBString processId,
DBString contextOperId,
DBInt freqId,
DBString segmentRequirementId,
DBString segmentResponseId,
DBString lotNo,
DBString subLotNo,
DateTime requestedTimeLocal,
DBDateTime expiryTimeLocal,
DBDateTime warningTimeLocal,
DBString pulledBy,
DBDateTime pulledTimeLocal,
Nullable<bool> final,
DBString finalizedBy,
DBDateTime finalizedAtLocal,
DBString verifiedBy,
int sampleStatus,
DBInt sampleResult,
DBString spare1,
DBString spare2,
DBString spare3,
DBString spare4,
DBString lastEditComment,
out int sampleId,
out DateTime lastEditAt
)
Parameters
- sessionId
- Required. Holds the session ID and thus the user who is making this method call.
- entId
- Required. Holds the Entity Id at which the sample was generated.
- sampleName
- Optional. Holds the sample name (created according to sample_plan.sample_name).
- itemId
- Optional. Holds the Item Id from which the sample was generated.
- woId
- Optional. Holds the Wo Id used to identify the job for which the sample was generated.
- operId
- Optional. Holds the Oper Id used to identify the job for which the sample was generated.
- seqNo
- Optional. Holds the Seq No used to identify the job for which the sample was generated.
- contextEntId
- Optional. Holds the Entity or Entity Class to which this specification applies.
- contextItemId
- Optional. Holds the Item to which this specification applies; if not null, item_category_id must be null.
- itemCategoryId
- Optional. Holds the ID of the Item Category to which this specification applies; if not null, item_id must be null.
- processId
- Optional. Holds the Process Id to which this specification applies; either both the Process Id and Context Oper Id must be null or both non-null.
- contextOperId
- Optional. Holds the Context Oper Id to which this specification applies; either both the Process Id and Context Oper Id must be null or both non-null.
- freqId
- Optional. Holds the ID of the sample plan frequency based upon which the sample was generated.
- segmentRequirementId
- Optional. User-specified S95 field.
- segmentResponseId
- Optional. User-specified S95 field.
- lotNo
- Optional. Identifies the lot from which the sample was pulled.
- subLotNo
- Optional. Identifies the sublot from which the sample was pulled.
- requestedTimeLocal
- Required. Holds the Local Date when the sample was requested (readied).
- expiryTimeLocal
- Optional. Holds the Local Date when the sample request expires.
- warningTimeLocal
- Optional. Holds the Local Date when the sample request turns to READY WARNING.
- pulledBy
- Optional. Holds the value of who the sample was pulled by.
- pulledTimeLocal
- Optional. Holds the Local Date when the sample was pulled.
- final
- Optional. Specified whether editing of any data associated with this sample is prohibited. Default = NO
- finalizedBy
- Optional. Specifies who marked the sample as final.
- finalizedAtLocal
- Optional. Holds the Local Date when the sample was marked as final.
- verifiedBy
- Optional. Specifies who verified the sample.
- sampleStatus
- Required. Specifies the status of the sample. 1 = READY, 2 = READY WARNING, 3 = MISSED, 4 = IN PROGRESS, 5 = LATE, 6 = COMPLETE, 7 = COMPLETE LATE, 8 = CANCELLED.
- sampleResult
- Optional. Specifies the result state of the sample. Default = Null (No data yet), 1 = PENDING , 2 = GOOD, 3 = OOC, 4 = OOS, 5 = OOC KEY, 6 = OOS KEY, 7 = OOC CRITICAL, 8 = OOS CRITICAL.
- 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.
- lastEditComment
- Optional. Holds comments that describe why this record is being added.
- sampleId
- Output. Holds the ID assigned to this record when it is added. The sampleId parameter is used by other methods that modify or delete this type of record.
- lastEditAt
- Output. Holds the datetime that this record was added.