SInvceDet::SeekByStatCod (Interface: SInvceDet)
 
Seeks a Sales Invoice Detail line by its statistics code.
 
VARIANT_BOOL SeekByStatCod (
    enum eSeekMode eSeekMode,
    BSTR bsStatisticsCode,
    DATE dDocDate,
    BSTR bsBook,
    LONG lDocNum,
    SHORT sLineNum
)
 
Key information
This method uses key number 7 (See SwapKey).
This is a unique key.
 
Key segment information
Segment NameTypeOrderCollation
pStatBSTRAscendingCase insensitive
pDocDateDATE (date)Ascending-
pBookBSTRAscendingCase insensitive
pDocNumLONG (unsigned)Ascending-
pLineNumSHORT (unsigned)Ascending-
 
Parameters
eSeekMode
[in] A value of the 'eSeekMode' enumeration.
bsStatisticsCode
[in] The statistics code of the Sales Invoice of which you want to seek a detail line.
dDocDate
[in] The document date of the Sales Invoice of which you want to seek a detail line.
bsBook
[in] The book code of the Sales Invoice of which you want to seek a detail line.
lDocNum
[in] The document number of the Sales Invoice of which you want to seek a detail line.
sLineNum
[in] The line number of the Sales 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)!
 
Return value
True if the record with the given properties was found, otherwise false.
 
See Also
CreateSInvceDet
GetDBStatus
GetNext
 
Samples
 
C++
 
// Seek the data of all detail lines of all sales invoices with a statistics code of 'STAT'
CString strStat = "STAT";
pSInvceDet->SeekByStatCod (smGreaterOrEqual, (LPCSTR)strStat, COleDateTime (0, 0, 0, 0, 0, 0).m_dt, "", 0, 0);
while (pSInvceDet->GetDBStatus () == 0 && (CString)pSInvceDet->pStat == strStat)
{
    // Process record data
    
    pSInvceDet->GetNext ();
}

C#
 
// Seek the data of all detail lines of all sales invoices with a statistics code of 'STAT'
string strStat = "STAT";
oSInvceDet.SeekByStatCod (eSeekMode.smGreaterOrEqual, strStat, new DateTime (), "", 0, 0);
while (oSInvceDet.GetDBStatus () == 0 && oSInvceDet.pStat.ToString () == strStat)
{
    // Process record data
    
    oSInvceDet.GetNext ();
}

VBS
 
' Seek the data of all detail lines of all sales invoices with a statistics code of 'STAT'
Dim strStat
Dim dtDocDate
strStat = "STAT"
Call oSInvceDet.SeekByStatCod(smGreaterOrEqual, strStat, dtDocDate, "", 0, 0)
While oSInvceDet.GetDBStatus() = 0 And oSInvceDet.pStat = strStat
    ' Process record data

    Call oSInvceDet.GetNext()
Wend

VB.NET
 
' Seek the data of all detail lines of all sales invoices with a statistics code of 'STAT'
Dim strStat As String
Dim dtDocDate As Date
strStat = "STAT"
oSInvceDet.SeekByStatCod(eSeekMode.smGreaterOrEqual, strStat, dtDocDate, "", 0, 0)
While oSInvceDet.GetDBStatus() = 0 And oSInvceDet.pStat = strStat
    ' Process record data

    oSInvceDet.GetNext()
End While