SOrderDet::SeekByDocument
 
Seeks a Sales Order Detail line by its document.
 
VARIANT_BOOL SeekByDocument (
    enum eSeekMode eSeekMode,
    BSTR bsBook,
    LONG lDocNum,
    SHORT sLineNum
)
 
Parameters
eSeekMode
[in] A value of the 'eSeekMode' enumeration.
bsBook
[in] The book code of the Sales Order of which you want to seek a detail line.
lDocNum
[in] The document number of the Sales Order of which you want to seek a detail line.
sLineNum
[in] The line number of the Sales Order Detail line you want to seek.
 
Remark
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.
 
Remarks
This method seeks the file using the key 'SRD_LNE' (key number 1).
 
See Also
CreateSOrderDet
GetDBStatus
GetNext
The UNIT4 C-Logic Description File 'Isr_d.cld' in the Cld-directory in the system path of your Venice installation.
 
Samples
 
C++
 
// Seek the data of all detail lines of the sales order with book code = 'FAC' and document number = 12
CString strBook = "FAC";
long lDocNum = 12;
pSOrderDet->SeekByDocument (smGreaterOrEqual, (LPCSTR)strBook, lDocNum, 0);
while (pSOrderDet->GetDBStatus () == 0 && (CString)pSOrderDet->pBook == strBook && (long)pSOrderDet->pDocNum == lDocNum)
{
    // Process record data
    
    pSOrderDet->GetNext ();
}

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

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

    Call oSOrderDet.GetNext()
Wend

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

    oSOrderDet.GetNext()
End While