Venice
Entry::SeekByHistory
 
Seeks an Entry record by its history.
 
VARIANT_BOOL SeekByHistory (
    enum eSeekMode eSeekMode,
    BSTR bsAccNum,
    DATE dBookDate,
    enum eBookType eBookType,
    BSTR bsBook,
    LONG lDocNum,
    SHORT sEntryNum
)
 
Key information
This method uses key number 1 (See SwapKey).
This key allows duplicates.
This is a null key, only the records where pAccount is not blank are in the index.
 
Key segment information
Segment NameTypeOrderCollation
pAccountBSTRAscendingCase sensitive
pBookDateDATE (date)Ascending-
pBookTypeBYTEAscending-
pBookBSTRAscendingCase insensitive
pDocNumLONG (unsigned)Ascending-
pEntryNumSHORT (unsigned)Ascending-
 
Parameters
eSeekMode
[in] A value of the 'eSeekMode' enumeration.
bsAccNum
[in] The account number of the Entry record you want to seek.
dBookDate
[in] The book date of the Entry record you want to seek.
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 all entry records for the account with number = '2009' and book date = 28/06/2024
CString    strAccNum = "2009";
COleDateTime odtBookDate;
odtBookDate.SetDate (2024, 6, 28);
pEntry->SeekByHistory (smGreaterOrEqual, (LPCSTR)strAccNum, odtBookDate, btMin, "", 0, 0);
while (pEntry->GetDBStatus () == 0 && (CString)pEntry->pAccount == strAccNum && (DATE)pEntry->pBookDate == odtBookDate)
{
    // Process record data
    
    pEntry->GetNext ();
}

C#
 
// Seek all entry records for the account with number = '2009' and book date = 28/06/2024
string strAccNum = "2009";
DateTime dtBookDate = new DateTime (2024, 6, 28);
oEntry.SeekByHistory (eSeekMode.smGreaterOrEqual, strAccNum, dtBookDate, eBookType.btMin, "", 0, 0);
while (oEntry.GetDBStatus () == 0 && oEntry.pAccount.ToString () == strAccNum && (DateTime)oEntry.pBookDate == dtBookDate)
{
    // Process record data
    
    oEntry.GetNext ();
}

VBS
 
' Seek all entry records for the account with number = '2009' and book date = 28/06/2024
Dim strAccNum
Dim dtBookDate
strAccNum = "2009"
dtBookDate = #6/28/2024#
Call oEntry.SeekByHistory(smGreaterOrEqual, strAccNum, dtBookDate, btMin, "", 0, 0)
While oEntry.GetDBStatus() = 0 And oEntry.pAccount = strAccNum And oEntry.pBookDate = dtBookDate
    ' Process record data

    Call oEntry.GetNext()
Wend

VB.NET
 
' Seek all entry records for the account with number = '2009' and book date = 28/06/2024
Dim strAccNum As String
Dim dtBookDate As Date
strAccNum = "2009"
dtBookDate = #6/28/2024#
oEntry.SeekByHistory(eSeekMode.smGreaterOrEqual, strAccNum, dtBookDate, eBookType.btMin, "", 0, 0)
While oEntry.GetDBStatus() = 0 And oEntry.pAccount = strAccNum And oEntry.pBookDate = dtBookDate
    ' Process record data

    oEntry.GetNext()
End While