Product::SeekByMainDoc (Interface: Product)
 
Seeks all Production Documents needed for one production.
 
VARIANT_BOOL SeekByMainDoc (
    enum eSeekMode eSeekMode,
    SHORT sMainDocYear,
    LONG lMainDocSysNum,
    DATE dStartDate
)
 
Key information
This method uses key number 8 (See SwapKey).
This key allows duplicates.
 
Key segment information
Segment NameTypeOrderCollation
pMainDocYearSHORT (unsigned)Ascending-
pMainDocSysNumLONGAscending-
pStartDateDATE (date)Ascending-
 
Parameters
eSeekMode
[in] A value of the 'eSeekMode' enumeration.
sMainDocYear
[in] The follow-up code of the Production Document Detail line you want to seek.
lMainDocSysNum
[in] The document date 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 belonging to the same main document as the current one
if ((LONG)pProduct->pMainDocSysNum != 0)
{
    pProduct->SeekByMainDoc (smGreaterOrEqual, (SHORT)pProduct->pMainDocYear, (LONG)pProduct->pMainDocSysNum, COleDateTime (0, 0, 0, 0, 0, 0).m_dt);
    while (pProduct->GetDBStatus () == 0)
    {
        // Process record data
        
        pProduct->GetNext ();
    }
}

C#
 
// Seek all production documents belonging to the same main document as the current one
if ((int)oProduct.pMainDocSysNum != 0)
{
    oProduct.SeekByMainDoc (eSeekMode.smGreaterOrEqual, (short)oProduct.pMainDocYear, (int)oProduct.pMainDocSysNum, new DateTime ());
    while (oProduct.GetDBStatus () == 0)
    {
        // Process record data

        oProduct.GetNext ();
    }
}

VBS
 
' Seek all production documents belonging to the same main document as the current one
If oProduct.pMainDocSysNum <> 0 Then
    Dim dtStartDate
    Call oProduct.SeekByMainDoc(smGreaterOrEqual, oProduct.pMainDocYear, oProduct.pMainDocSysNum, dtStartDate)
    While oProduct.GetDBStatus() = 0
        ' Process record data

        Call oProduct.GetNext()
    Wend
End If

VB.NET
 
' Seek all production documents belonging to the same main document as the current one
If oProduct.pMainDocSysNum <> 0 Then
    Dim dtStartDate As Date
    oProduct.SeekByMainDoc(eSeekMode.smGreaterOrEqual, oProduct.pMainDocYear, oProduct.pMainDocSysNum, dtStartDate)
    While oProduct.GetDBStatus() = 0
        ' Process record data

        Call oProduct.GetNext()
    End While
End If