PInvceDet::SeekBySupNum (Interface: PInvceDet)
 
Seeks a Purchase Invoice Detail line by its supplier number.
 
VARIANT_BOOL SeekBySupNum (
    enum eSeekMode eSeekMode,
    LONG lSupNum,
    LONG lSubNum,
    DATE dDocDate,
    BSTR bsBook,
    LONG lDocNum,
    SHORT sLineNum
)
 
Key information
This method uses key number 3 (See SwapKey).
This is a unique key.
 
Key segment information
Segment NameTypeOrderCollation
pSupNumLONG (unsigned)Ascending-
pSupSubNumLONG (unsigned)Ascending-
pDocDateDATE (date)Ascending-
pBookBSTRAscendingCase insensitive
pDocNumLONG (unsigned)Ascending-
pLineNumSHORT (unsigned)Ascending-
 
Parameters
eSeekMode
[in] A value of the 'eSeekMode' enumeration.
lSupNum
[in] The supplier number of the Purchase Invoice of which you want to seek a detail line.
lSubNum
[in] The supplier subnumber of the Purchase Invoice of which you want to seek a detail line.
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)!
 
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 of all purchase invoices for the supplier with number 125/0 with a document date of '31/03/2024'
COleDateTime odtDocDate;
odtDocDate.SetDate (2024, 3, 31);
long lSupNum = 125, lSubNum = 0;
pPInvceDet->SeekBySupNum (smGreaterOrEqual, lSupNum, lSubNum, odtDocDate, "", 0, 0);
while (pPInvceDet->GetDBStatus () == 0 && (long)pPInvceDet->pSupNum == lSupNum && (long)pPInvceDet->pSupSubNum == lSubNum && (DATE)pPInvceDet->pDocDate == odtDocDate)
{
    // Process record data
    
    pPInvceDet->GetNext ();
}

C#
 
// Seek the data of all detail lines of all purchase invoices for the supplier with number 125/0 with a document date of '31/03/2024'
DateTime dtDocDate = new DateTime (2024, 3, 31);
int iSupNum = 125, iSubNum = 0;
oPInvceDet.SeekBySupNum (eSeekMode.smGreaterOrEqual, iSupNum, iSubNum, dtDocDate, "", 0, 0);
while (oPInvceDet.GetDBStatus () == 0 && (int)oPInvceDet.pSupNum == iSupNum && (int)oPInvceDet.pSupSubNum == iSubNum && (DateTime)oPInvceDet.pDocDate == dtDocDate)
{
    // Process record data
    
    oPInvceDet.GetNext ();
}

VBS
 
' Seek the data of all detail lines of all purchase invoices for the supplier with number 125/0 with a document date of '31/03/2024'
Dim dtDocDate
Dim iSupNum, iSubNum
dtDocDate = #3/31/2024#
iSupNum = 125
iSubNum = 0
Call oPInvceDet.SeekBySupNum(smGreaterOrEqual, iSupNum, iSubNum, dtDocDate, "", 0, 0)
While oPInvceDet.GetDBStatus() = 0 And oPInvceDet.pSupNum = iSupNum And oPInvceDet.pSupSubNum = iSubNum And oPInvceDet.pDocDate = dtDocDate
    ' Process record data

    Call oPInvceDet.GetNext()
Wend

VB.NET
 
' Seek the data of all detail lines of all purchase invoices for the supplier with number 125/0 with a document date of '31/03/2024'
Dim dtDocDate As Date
Dim iSupNum, iSubNum As Integer
dtDocDate = #3/31/2024#
iSupNum = 125
iSubNum = 0
oPInvceDet.SeekBySupNum(eSeekMode.smGreaterOrEqual, iSupNum, iSubNum, dtDocDate, "", 0, 0)
While oPInvceDet.GetDBStatus() = 0 And oPInvceDet.pSupNum = iSupNum And oPInvceDet.pSupSubNum = iSubNum And oPInvceDet.pDocDate = dtDocDate
    ' Process record data

    oPInvceDet.GetNext()
End While