SOfferDet::SwapKey (Interface: SOfferDet)
 
Swaps the file to another key.
 
VARIANT_BOOL SwapKey (
    SHORT sKeyNum
)
 
Parameters
sKeyNum
[in] The number of the key by which you want the file positioned.
 
Return value
True if the file was positioned according to the given key, otherwise false (e.g. if the current record is a null value for the given key or if an invalid sKeyNum was supplied).
 
See Also
CreateSOfferDet
SeekBySysNum
GetDBStatus
GetNext
The possible keys (and their numerical value) can be found in the SeekBy-methods of this interface.
 
Samples
 
C++
 
// Seek the sales offer detail line with system number 17
if (pSOfferDet->SeekBySysNum (smEqual, 17))
{
    // Swap the key to 'SOD_LNE' (1), positioning by document
    pSOfferDet->SwapKey (1);
    // Navigate through the file using the key 'SOD_LNE'
    while (pSOfferDet->GetDBStatus () == 0)
    {
        // Process record data
        
        pSOfferDet->GetNext ();
    }
}

C#
 
// Seek the sales offer detail line with system number 17
if (oSOfferDet.SeekBySysNum (eSeekMode.smEqual, 17))
{
    // Swap the key to 'SOD_LNE' (1), positioning by document
    oSOfferDet.SwapKey (1);
    // Navigate through the file using the key 'SOD_LNE'
    while (oSOfferDet.GetDBStatus () == 0)
    {
        // Process record data
        
        oSOfferDet.GetNext ();
    }
}

VBS
 
' Seek the sales offer detail line with system number 17
If oSOfferDet.SeekBySysNum(smEqual, 17) Then
    ' Swap the key to 'SOD_LNE' (1), positioning by document
    Call oSOfferDet.SwapKey(1)
    ' Navigate through the file using the key 'SOD_LNE'
    While oSOfferDet.GetDBStatus() = 0
        ' Process record data
        
        Call oSOfferDet.GetNext()
    Wend
End If

VB.NET
 
' Seek the sales offer detail line with system number 17
If oSOfferDet.SeekBySysNum(eSeekMode.smEqual, 17) Then
    ' Swap the key to 'SRD_LNE' (1), positioning by document
    oSOfferDet.SwapKey(1)
    ' Navigate through the file using the key 'SRD_LNE'
    While oSOfferDet.GetDBStatus() = 0
        ' Process record data
        
        oSOfferDet.GetNext()
    End While
End If