Entry::SeekByDocNum (Interface: Entry)
 
Seeks an Entry record by its document number.
 
VARIANT_BOOL SeekByDocNum (
    enum eSeekMode eSeekMode,
    enum eBookType eBookType,
    BSTR bsBook,
    LONG lDocNum,
    SHORT sEntryNum
)
 
Key information
This method uses key number 3 (See SwapKey).
This is a unique key.
 
Key segment information
Segment NameTypeOrderCollation
pBookTypeBYTEAscending-
pBookBSTRAscendingCase insensitive
pDocNumLONG (unsigned)Ascending-
pEntryNumSHORT (unsigned)Ascending-
 
Parameters
eSeekMode
[in] A value of the 'eSeekMode' enumeration.
eBookType
[in] A value of the 'eBookType' enumeration.
bsBook
[in] The book code of the Entry record you want to seek.
lDocNum
[in] The document number of the Entry record you want to seek.
sEntryNum
[in] The entry number of the Entry record you want to seek.
 
Return value
True if the record with the given properties was found, otherwise false.
 
See Also
CreateEntry
GetDBStatus
GetNext
 
Samples
 
C++
 
// Seek the data of all detail lines of the sundry document with book code = 'VAT' and document number = 12
CString strBook = "VAT";
long lDocNum = 12;
eBookType eBT = btSndry;
pEntry->SeekByDocNum (smGreaterOrEqual, eBT, (LPCSTR)strBook, lDocNum, 0);
while (pEntry->GetDBStatus () == 0 && (BYTE)pEntry->pBookType == eBT && (CString)pEntry->pBook == strBook && (long)pEntry->pDocNum == lDocNum)
{
    // Process record data
    
    pEntry->GetNext ();
}

C#
 
// Seek the data of all detail lines of the sundry document with book code = 'VAT' and document number = 12
string strBook = "VAT";
int iDocNum = 12;
eBookType eBT = eBookType.btSndry;
oEntry.SeekByDocNum (eSeekMode.smGreaterOrEqual, eBT, strBook, iDocNum, 0);
while (oEntry.GetDBStatus () == 0 && (eBookType)((byte)oEntry.pBookType) == eBT && oEntry.pBook.ToString () == strBook && (int)oEntry.pDocNum == iDocNum)
{
    // Process record data
    
    oEntry.GetNext ();
}

VBS
 
' Seek the data of all detail lines of the sundry document with book code = 'VAT' and document number = 12
Dim strBook
Dim lDocNum
Dim eBT
strBook = "VAT"
lDocNum = 12
eBT = btSndry
Call oEntry.SeekByDocNum(smGreaterOrEqual, eBT, strBook, lDocNum, 0)
While oEntry.GetDBStatus() = 0 And oEntry.pBookType = eBT And oEntry.pBook = strBook And oEntry.pDocNum = lDocNum
    ' Process record data

    Call oEntry.GetNext()
Wend

VB.NET
 
' Seek the data of all detail lines of the sundry document with book code = 'VAT' and document number = 12
Dim strBook As String
Dim lDocNum As Long
Dim eBT As eBookType
strBook = "VAT"
lDocNum = 12
eBT = eBookType.btSndry
oEntry.SeekByDocNum(eSeekMode.smGreaterOrEqual, eBT, strBook, lDocNum, 0)
While oEntry.GetDBStatus() = 0 And oEntry.pBookType = eBT And oEntry.pBook = strBook And oEntry.pDocNum = lDocNum
    ' Process record data

    oEntry.GetNext()
End While