Venice
PInvceDet::SeekByFreeCat
 
Seeks a Purchase Invoice Detail line by its free category.
 
VARIANT_BOOL SeekByFreeCat (
    enum eSeekMode eSeekMode,
    BSTR bsFreeCategory,
    DATE dDocDate,
    BSTR bsBook,
    LONG lDocNum,
    SHORT sLineNum,
    BYTE byIndex
)
 
Key information
This method uses key number 9+index (See SwapKey).
This is a unique key.
 
Key segment information
Segment NameTypeOrderCollation
(pFreeCategory1+index)BSTRAscendingCase insensitive
pDocDateDATE (date)Ascending-
pBookBSTRAscendingCase insensitive
pDocNumLONG (unsigned)Ascending-
pLineNumSHORT (unsigned)Ascending-
 
Parameters
eSeekMode
[in] A value of the 'eSeekMode' enumeration.
bsFreeCategory
[in] The free category code of the article of the Purchase Invoice Detail line you want to seek.
dDocDate
[in] The document date of the Purchase Invoice of which you want to seek a detail line.
bsBook
[in] The book code of the Purchase Invoice of which you want to seek a detail line.
lDocNum
[in] The document number of the Purchase Invoice of which you want to seek a detail line.
sLineNum
[in] The line number of the Purchase Invoice 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)!
byIndex
[in] The index of the free category you want to seek by. The value of this index must be 0 or 1.
 
Return value
True if the record with the given properties was found, otherwise false.
 
See Also
CreatePInvceDet
GetDBStatus
GetNext
 
Samples
 
C++
 
// Seek the data of all detail lines with an article number of which the free category 2 = 'Yellow' of all purchase invoices
CString strFreeCat = "Yellow";
pPInvceDet->SeekByFreeCat (smGreaterOrEqual, (LPCSTR)strFreeCat, COleDateTime (0, 0, 0, 0, 0, 0).m_dt, "", 0, 0, 1);
while (pPInvceDet->GetDBStatus () == 0 && (CString)pPInvceDet->pFreeCategory2 == strFreeCat)
{
    // Process record data
    
    pPInvceDet->GetNext ();
}

C#
 
// Seek the data of all detail lines with an article number of which the free category 2 = 'Yellow' of all purchase invoices
string strFreeCat = "Yellow";
oPInvceDet.SeekByFreeCat (eSeekMode.smGreaterOrEqual, strFreeCat, new DateTime (), "", 0, 0, 1);
while (oPInvceDet.GetDBStatus () == 0 && oPInvceDet.pFreeCategory2.ToString () == strFreeCat)
{
    // Process record data
    
    oPInvceDet.GetNext ();
}

VBS
 
' Seek the data of all detail lines with an article number of which the free category 2 = 'Yellow' of all purchase invoices
Dim strFreeCat
Dim dtDocDate
strFreeCat = "Yellow"
Call oPInvceDet.SeekByFreeCat(smGreaterOrEqual, strFreeCat, dtDocDate, "", 0, 0, 1)
While oPInvceDet.GetDBStatus() = 0 And oPInvceDet.pFreeCategory2 = strFreeCat
    ' Process record data

    Call oPInvceDet.GetNext()
Wend

VB.NET
 
' Seek the data of all detail lines with an article number of which the free category 2 = 'Yellow' of all purchase invoices
Dim strFreeCat As String
Dim dtDocDate As Date
strFreeCat = "Yellow"
oPInvceDet.SeekByFreeCat(eSeekMode.smGreaterOrEqual, strFreeCat, dtDocDate, "", 0, 0, 1)
While oPInvceDet.GetDBStatus() = 0 And oPInvceDet.pFreeCategory2 = strFreeCat
    ' Process record data

    oPInvceDet.GetNext()
End While