StValDet::SeekByErrCod (Interface: StValDet)
 
Seeks a Stock Valuation Detail by its error code.
 
VARIANT_BOOL SeekByErrCod (
    enum eSeekMode eSeekMode,
    DATE dEndDate,
    enum eErrorCode eErrorCode,
    BSTR bsWarehouse,
    BSTR bsArtNum
)
 
Key information
This is a unique key.
This is a null key, only the records where pErrorCode is not 0 are in the index.
 
Key segment information
Segment NameTypeOrderCollation
pEndDateDATE (date)Ascending-
pErrorCodeBYTEAscending-
pWarehouseBSTRAscendingCase insensitive
pArtNumBSTRAscendingHierarchy
 
Parameters
eSeekMode
[in] A value of the 'eSeekMode' enumeration.
dEndDate
[in] The end date of the stock valuation detail you want to seek.
eErrorCode
[in] A value of the 'eErrorCode' enumeration.
bsWarehouse
[in] The warehouse code of the stock valuation detail you want to seek.
bsArtNum
[in] The article number of the stock valuation detail you want to seek.
 
Return value
True if the record with the given properties was found, otherwise false.
 
See Also
CreateStValDet
 
Samples
 
C++
 
// Seek all stock valuation details with an error code of 'ecNegativeStock' for the valuation that ended on 15/06/2024
COleDateTime odtEndDate;
odtEndDate.SetDate (2024, 6, 15);

pStValDet->SeekByErrCod (smGreater, odtEndDate, ecNegativeStock, "", "");
while (pStValDet->GetDBStatus () == 0 && (DATE)pStValDet->pEndDate == odtEndDate && (eErrorCode)pStValDet->pErrorCode.bVal == ecNegativeStock)
{
    // Process record data
    
    pStValDet->GetNext ();
}

C#
 
// Seek all stock valuation details with an error code of 'ecNegativeStock' for the valuation that ended on 15/06/2024
DateTime dtEndDate = new DateTime (2024, 6, 15);

oStValDet.SeekByErrCod (eSeekMode.smGreater, dtEndDate, eErrorCode.ecNegativeStock, "", "");
while (oStValDet.GetDBStatus () == 0 && (DateTime)oStValDet.pEndDate == dtEndDate && (eErrorCode)(byte)oStValDet.pErrorCode == eErrorCode.ecNegativeStock)
{
    // Process record data
    
    oStValDet.GetNext ();
}

VBS
 
' Seek all stock valuation details with an error code of 'ecNegativeStock' for the valuation that ended on 15/06/2024
Dim dtEndDate
dtEndDate = #6/15/2024#

Call oStValDet.SeekByErrCod(smGreater, dtEndDate, ecNegativeStock, "", "")
While oStValDet.GetDBStatus() = 0 And oStValDet.pEndDate = dtEndDate And oStValDet.pErrorCode = ecNegativeStock
    ' Process record data

    Call oStValDet.GetNext()
Wend

VB.NET
 
' Seek all stock valuation details with an error code of 'ecNegativeStock' for the valuation that ended on 15/06/2024
Dim dtEndDate As Date
dtEndDate = #6/28/2024#

oStValDet.SeekByErrCod(eSeekMode.smGreater, dtEndDate, eErrorCode.ecNegativeStock, "", "")
While oStValDet.GetDBStatus() = 0 And oStValDet.pEndDate = dtEndDate And oStValDet.pErrorCode = eErrorCode.ecNegativeStock
    ' Process record data

    oStValDet.GetNext()
End While