Venice
StockDocDet::SeekByDocument
 
Seeks a Stock Document Detail line by its document.
 
VARIANT_BOOL SeekByDocument (
    enum eSeekMode eSeekMode,
    BSTR bsBook,
    LONG lDocNum,
    LONG lLineNum
)
 
Key information
This method uses key number 1 (See SwapKey).
This is a unique key.
 
Key segment information
Segment NameTypeOrderCollation
pBookBSTRAscendingCase insensitive
pDocNumLONG (unsigned)Ascending-
pLineNumLONG (unsigned)Ascending-
 
Parameters
eSeekMode
[in] A value of the 'eSeekMode' enumeration.
bsBook
[in] The book code of the stock document of which you want to seek a detail line.
lDocNum
[in] The document number of the stock document of which you want to seek a detail line.
lLineNum
[in] The line number of the stock document detail line you want to seek.
 
Remarks
This number is a 0-based index, i.e. it starts from 0. Therefore the value of this parameter is 1 less than the numbers shown in the Venice grids and 1 less than the value returned by the property vLine (see properties)!
 
Return value
True if the record with the given properties was found, otherwise false.
 
See Also
CreateStockDocDet
GetDBStatus
GetNext
 
Samples
 
C++
 
// Seek the data of all detail lines of the stock document with book code = 'STC' and document number = 12
CString strBook = "STC";
long lDocNum = 12;
pStockDocDet->SeekByDocument (smGreaterOrEqual, (LPCSTR)strBook, lDocNum, 0);
while (pStockDocDet->GetDBStatus () == 0 && (CString)pStockDocDet->pBook == strBook && (long)pStockDocDet->pDocNum == lDocNum)
{
    // Process record data
    
    pStockDocDet->GetNext ();
}

C#
 
// Seek the data of all detail lines of the stock document with book code = 'STC' and document number = 12
string strBook = "STC";
int iDocNum = 12;
oStockDocDet.SeekByDocument (eSeekMode.smGreaterOrEqual, strBook, iDocNum, 0);
while (oStockDocDet.GetDBStatus () == 0 && oStockDocDet.pBook.ToString () == strBook && (int)oStockDocDet.pDocNum == iDocNum)
{
    // Process record data
    
    oStockDocDet.GetNext ();
}

VBS
 
' Seek the data of all detail lines of the stock document with book code = 'STC' and document number = 12
Dim strBook
Dim lDocNum
strBook = "STC"
lDocNum = 12
Call oStockDocDet.SeekByDocument(smGreaterOrEqual, strBook, lDocNum, 0)
While oStockDocDet.GetDBStatus() = 0 And oStockDocDet.pBook = strBook And oStockDocDet.pDocNum = lDocNum
    ' Process record data

    Call oStockDocDet.GetNext()
Wend

VB.NET
 
' Seek the data of all detail lines of the stock document with book code = 'STC' and document number = 12
Dim strBook As String
Dim lDocNum As Long
strBook = "STC"
lDocNum = 12
oStockDocDet.SeekByDocument(eSeekMode.smGreaterOrEqual, strBook, lDocNum, 0)
While oStockDocDet.GetDBStatus() = 0 And oStockDocDet.pBook = strBook And oStockDocDet.pDocNum = lDocNum
    ' Process record data

    oStockDocDet.GetNext()
End While