Venice
PDelivDet::SeekByDocument
 
Seeks a Purchase Delivery Detail line by its document.
 
VARIANT_BOOL SeekByDocument (
    enum eSeekMode eSeekMode,
    BSTR bsBook,
    LONG lDocNum,
    SHORT sLineNum
)
 
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-
pLineNumSHORT (unsigned)Ascending-
 
Parameters
eSeekMode
[in] A value of the 'eSeekMode' enumeration.
bsBook
[in] The book code of the Purchase Delivery of which you want to seek a detail line.
lDocNum
[in] The document number of the Purchase Delivery of which you want to seek a detail line.
sLineNum
[in] The line number of the Purchase Delivery 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
CreatePDelivDet
GetDBStatus
GetNext
 
Samples
 
C++
 
// Seek the data of all detail lines of the purchase delivery with book code = 'FAC' and document number = 12
CString strBook = "FAC";
long lDocNum = 12;
pPDelivDet->SeekByDocument (smGreaterOrEqual, (LPCSTR)strBook, lDocNum, 0);
while (pPDelivDet->GetDBStatus () == 0 && (CString)pPDelivDet->pBook == strBook && (long)pPDelivDet->pDocNum == lDocNum)
{
    // Process record data
    
    pPDelivDet->GetNext ();
}

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

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

    Call oPDelivDet.GetNext()
Wend

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

    oPDelivDet.GetNext()
End While