Venice
SInvceDet::SeekByCstArt
 
Seeks a Sales Invoice Detail line by its customer number and article.
 
VARIANT_BOOL SeekByCstArt (
    enum eSeekMode eSeekMode,
    LONG lCstNum,
    LONG lSubNum,
    BSTR bsArticleNumber,
    DATE dDocDate,
    BSTR bsBook,
    LONG lDocNum,
    SHORT sLineNum
)
 
Key information
This method uses key number 4 (See SwapKey).
This is a unique key.
 
Key segment information
Segment NameTypeOrderCollation
pCstNumLONG (unsigned)Ascending-
pCstSubNumLONG (unsigned)Ascending-
pArtNumBSTRAscendingHierarchy
pDocDateDATE (date)Ascending-
pBookBSTRAscendingCase insensitive
pDocNumLONG (unsigned)Ascending-
pLineNumSHORT (unsigned)Ascending-
 
Parameters
eSeekMode
[in] A value of the 'eSeekMode' enumeration.
lCstNum
[in] The customer number of the Sales Invoice of which you want to seek a detail line.
lSubNum
[in] The customer subnumber of the Sales Invoice of which you want to seek a detail line.
bsArticleNumber
[in] The article number of the Sales Invoice Detail line you want to seek.
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 for the article with number = 'Art_001' of all sales invoices for the customer with number 25/0
long lCstNum = 25, lSubNum = 0;
CString strArtNum = "Art_001";
pSInvceDet->SeekByCstArt (smGreaterOrEqual, lCstNum, lSubNum, (LPCSTR)strArtNum, COleDateTime (0, 0, 0, 0, 0, 0).m_dt, "", 0, 0);
while (pSInvceDet->GetDBStatus () == 0 && (long)pSInvceDet->pCstNum == lCstNum && (long)pSInvceDet->pCstSubNum == lSubNum && (CString)pSInvceDet->pArtNum == strArtNum)
{
    // Process record data
    
    pSInvceDet->GetNext ();
}

C#
 
// Seek the data of all detail lines for the article with number = 'Art_001' of all sales invoices for the customer with number 25/0
int iCstNum = 25, iSubNum = 0;
string strArtNum = "Art_001";
oSInvceDet.SeekByCstArt (eSeekMode.smGreaterOrEqual, iCstNum, iSubNum, strArtNum, new DateTime (), "", 0, 0);
while (oSInvceDet.GetDBStatus () == 0 && (int)oSInvceDet.pCstNum == iCstNum && (int)oSInvceDet.pCstSubNum == iSubNum && oSInvceDet.pArtNum.ToString () == strArtNum)
{
    // Process record data
    
    oSInvceDet.GetNext ();
}

VBS
 
' Seek the data of all detail lines for the article with number = 'Art_001' of all sales invoices for the customer with number 25/0
Dim iCstNum, iSubNum
Dim strArtNum
Dim dtDocDate
iCstNum = 25
iSubNum = 0
strArtNum = "Art_001"
Call oSInvceDet.SeekByCstArt(smGreaterOrEqual, iCstNum, iSubNum, strArtNum, dtDocDate, "", 0, 0)
While oSInvceDet.GetDBStatus() = 0 And oSInvceDet.pCstNum = iCstNum And oSInvceDet.pCstSubNum = iSubNum And oSInvceDet.pArtNum = strArtNum
    ' Process record data

    Call oSInvceDet.GetNext()
Wend

VB.NET
 
' Seek the data of all detail lines for the article with number = 'Art_001' of all sales invoices for the customer with number 25/0
Dim iCstNum, iSubNum As Integer
Dim strArtNum As String
Dim dtDocDate As Date
iCstNum = 25
iSubNum = 0
strArtNum = "Art_001"
oSInvceDet.SeekByCstArt(eSeekMode.smGreaterOrEqual, iCstNum, iSubNum, strArtNum, dtDocDate, "", 0, 0)
While oSInvceDet.GetDBStatus() = 0 And oSInvceDet.pCstNum = iCstNum And oSInvceDet.pCstSubNum = iSubNum And oSInvceDet.pArtNum = strArtNum
    ' Process record data

    oSInvceDet.GetNext()
End While