Venice
POrderDet::SwapKey
 
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
CreatePOrderDet
Browse
GetDBStatus
GetNext
The possible keys (and their numerical value) can be found in the SeekBy-methods of this interface.
 
Samples
 
C++
 
// Browse for a purchase order detail line, which positions the file by a key that is unknown
pPOrderDet->Browse (VARIANT_FALSE);
// Swap the key to 'PRD_LNE' (1), positioning by document
pPOrderDet->SwapKey (1);
// Navigate through the file using the key 'PRD_LNE'
while (pPOrderDet->GetDBStatus () == 0)
{
    // Process record data
    
    pPOrderDet->GetNext ();
}

C#
 
// Browse for a purchase order detail line, which positions the file by a key that is unknown
oPOrderDet.Browse (false);
// Swap the key to 'PRD_LNE' (1), positioning by document
oPOrderDet.SwapKey (1);
// Navigate through the file using the key 'PRD_LNE'
while (oPOrderDet.GetDBStatus () == 0)
{
    // Process record data
    
    oPOrderDet.GetNext ();
}

VBS
 
' Browse for a purchase order detail line, which positions the file by a key that is unknown
Call oPOrderDet.Browse(False)
' Swap the key to 'PRD_LNE' (1), positioning by document
Call oPOrderDet.SwapKey(1)
' Navigate through the file using the key 'PRD_LNE'
While oPOrderDet.GetDBStatus() = 0
    ' Process record data
    
    Call oPOrderDet.GetNext()
Wend

VB.NET
 
' Browse for a purchase order detail line, which positions the file by a key that is unknown
oPOrderDet.Browse(False)
' Swap the key to 'PRD_LNE' (1), positioning by document
oPOrderDet.SwapKey(1)
' Navigate through the file using the key 'PRD_LNE'
While oPOrderDet.GetDBStatus() = 0
    ' Process record data
    
    oPOrderDet.GetNext()
End While