Product::SeekByArtNum (Interface: Product)
 
Seeks a Production Document by its article number.
 
VARIANT_BOOL SeekByArtNum (
    enum eSeekMode eSeekMode,
    BSTR bsArtNum,
    DATE dStartDate
)
 
Key information
This method uses key number 3 (See SwapKey).
This key allows duplicates.
 
Key segment information
Segment NameTypeOrderCollation
pArtNumBSTRAscendingHierarchy
pStartDateDATE (date)Ascending-
 
Parameters
eSeekMode
[in] A value of the 'eSeekMode' enumeration.
bsArtNum
[in] The article number of the Production Document you want to seek.
dStartDate
[in] The start date of the Production Document you want to seek.
 
Return value
True if the record with the given properties was found, otherwise false.
 
See Also
CreateProduct
GetDBStatus
GetNext
 
Samples
 
C++
 
// Seek all production documents for article 'Art_001' with a starting date after 01/04/2024
COleDateTime odtStartDate;
CString strArtNum = "Art_001";
odtStartDate.SetDate (2024, 4, 1);
pProduct->SeekByArtNum (smGreater, (LPCSTR)strArtNum, odtStartDate);
while (pProduct->GetDBStatus () == 0 && (CString)pProduct->pArtNum == strArtNum && (DATE)pProduct->pStartDate > odtStartDate)
{
    // Process record data
    
    pProduct->GetNext ();
}

C#
 
// Seek all production documents for article 'Art_001' with a starting date after 01/04/2024
DateTime dtStartDate = new DateTime (2024, 4, 1);
string strArtNum = "Art_001";
oProduct.SeekByArtNum (eSeekMode.smGreater, strArtNum, dtStartDate);
while (oProduct.GetDBStatus () == 0 && oProduct.pArtNum.ToString () == strArtNum && (DateTime)oProduct.pStartDate > dtStartDate)
{
    // Process record data
    
    oProduct.GetNext ();
}

VBS
 
Dim dtStartDate
Dim strArtNum
dtStartDate = #4/1/2024#
strArtNum = "Art_001"
Call oProduct.SeekByArtNum(smGreater, strArtNum, dtStartDate)
While oProduct.GetDBStatus() = 0 And oProduct.pArtNum = strArtNum And oProduct.pStartDate > dtStartDate
    ' Process record data

    Call oProduct.GetNext()
Wend

VB.NET
 
Dim dtStartDate As Date
Dim strArtNum As String
dtStartDate = #4/1/2024#
strArtNum = "Art_001"
oProduct.SeekByArtNum(eSeekMode.smGreater, strArtNum, dtStartDate)
While oProduct.GetDBStatus() = 0 And oProduct.pArtNum = strArtNum And oProduct.pStartDate > dtStartDate
    ' Process record data

    oProduct.GetNext()
End While