MaCrd::SeekByCrdDoc (Interface: MaCrd)
 
Seeks a Material Assets card by its credit document.
 
VARIANT_BOOL SeekByCrdDoc (
    enum eSeekMode eSeekMode,
    SHORT sAccYear,
    BSTR bsBook,
    LONG lDocNum
)
 
Key information
This method uses key number 5 (See SwapKey).
This key allows duplicates.
This is a null key, only the records where pCredAccYear is not 0 and pCredDocNum is not 0 are in the index.
 
Key segment information
Segment NameTypeOrderCollation
pCredAccYearSHORT (unsigned)Ascending-
pCredBookBSTRAscendingCase insensitive
pCredDocNumLONG (unsigned)Ascending-
 
Parameters
eSeekMode
[in] A value of the 'eSeekMode' enumeration.
sAccYear
[in] The financial year of the credit document you want to seek the material assets card by.
bsBook
[in] The book code of the credit document you want to seek the material assets card by.
lDocNum
[in] The document number of the credit document you want to seek the material assets card by.
 
Return value
True if the record with the given properties was found, otherwise false.
 
See Also
CreateMaCrd
GetDBStatus
GetNext
 
Samples
 
C++
 
// Seek all the material assets cards that have a reference to the credit document '2024 CRD 000.086'
CString strBook = "CRD";
DWORD dwDocNum = 86;
USHORT usAccYear = 2024;
pMaCrd->SeekByCrdDoc (smEqual, usAccYear, (LPCSTR)strBook, dwDocNum);
while ( pMaCrd->GetDBStatus () == 0 &&
        (USHORT)pMaCrd->pCredAccYear == usAccYear &&
        (CString)pMaCrd->pCredBook == strBook &&
        (DWORD)pMaCrd->pCredDocNum == dwDocNum)
{
    // Process record data
    
    pMaCrd->GetNext ();
}

C#
 
// Seek all the material assets cards that have a reference to the credit document '2024 CRD 000.086'
string strBook = "CRD";
int iDocNum = 86;
short sAccYear = 2024;
oMaCrd.SeekByCrdDoc (eSeekMode.smEqual, sAccYear, strBook, iDocNum);
while ( oMaCrd.GetDBStatus () == 0 &&
        (short)oMaCrd.pCredAccYear == sAccYear &&
        oMaCrd.pCredBook.ToString () == strBook &&
        (int)oMaCrd.pCredDocNum == iDocNum)
{
    // Process record data
    
    oMaCrd.GetNext ();
}

VBS
 
' Seek all the material assets cards that have a reference to the credit document '2024 CRD 000.086'
Dim strBook
Dim lDocNum
Dim sAccYear
strBook = "CRD"
lDocNum = 86
sAccYear = 2024
Call oMaCrd.SeekByCrdDoc(smEqual, sAccYear, strBook, lDocNum)
While oMaCrd.GetDBStatus() = 0 And oMaCrd.pCredAccYear = sAccYear And oMaCrd.pCredBook = strBook And oMaCrd.pCredDocNum = lDocNum
    ' Process record data

    Call oMaCrd.GetNext()
Wend

VB.NET
 
' Seek all the material assets cards that have a reference to the credit document '2024 CRD 000.086'
Dim strBook As String
Dim lDocNum As Long
Dim sAccYear As Short
strBook = "CRD"
lDocNum = 86
sAccYear = 2024
oMaCrd.SeekByCrdDoc(eSeekMode.smEqual, sAccYear, strBook, lDocNum)
While oMaCrd.GetDBStatus() = 0 And oMaCrd.pCredAccYear = sAccYear And oMaCrd.pCredBook = strBook And oMaCrd.pCredDocNum = lDocNum
    ' Process record data

    oMaCrd.GetNext()
End While