Purch::SeekByBookDate (Interface: Purch)
 
Seeks a Purchase Document by its book date.
 
VARIANT_BOOL SeekByBookDate (
    enum eSeekMode eSeekMode,
    DATE dBookDate
)
 
Key information
This method uses key number 4 (See SwapKey).
This key allows duplicates.
 
Key segment information
Segment NameTypeOrderCollation
pBookDateDATE (date)Ascending-
 
Parameters
eSeekMode
[in] A value of the 'eSeekMode' enumeration.
dBookDate
[in] The book date of the Purchase Document you want to seek.
 
Return value
True if the record with the given properties was found, otherwise false.
 
See Also
CreatePurch
GetDBStatus
GetNext
 
Samples
 
C++
 
// Seek all documents with book date = 28/06/2024
COleDateTime odtBookDate;
odtBookDate.SetDate (2024, 6, 28);
pPurch->SeekByBookDate (smEqual, odtBookDate);
while (pPurch->GetDBStatus () == 0 && (DATE)pPurch->pBookDate == odtBookDate)
{
    // Process record data

    pPurch->GetNext ();
}

C#
 
// Seek all documents with book date = 28/06/2024
DateTime dtBookDate = new DateTime (2024, 6, 28);
oPurch.SeekByBookDate (eSeekMode.smEqual, dtBookDate);
while (oPurch.GetDBStatus () == 0 && (DateTime)oPurch.pBookDate == dtBookDate)
{
    // Process record data
    
    oPurch.GetNext ();
}

VBS
 
' Seek all documents with book date = 28/06/2024
Dim dtBookDate
dtBookDate = #6/28/2024#
Call oPurch.SeekByBookDate(smEqual, dtBookDate)
While oPurch.GetDBStatus() = 0 And oPurch.pBookDate = dtBookDate
    ' Process record data

    Call oPurch.GetNext()
Wend

VB.NET
 
' Seek all documents with book date = 28/06/2024
Dim dtBookDate As Date
dtBookDate = #6/28/2024#
oPurch.SeekByBookDate(eSeekMode.smEqual, dtBookDate)
While oPurch.GetDBStatus() = 0 And oPurch.pBookDate = dtBookDate
    ' Process record data

    oPurch.GetNext()
End While