Venice
SInvceDet::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
CreateSInvceDet
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 sales invoice detail line, which positions the file by a key that is unknown
pSInvceDet->Browse (VARIANT_FALSE);
// Swap the key to 'SID_LNE' (1), positioning by document
pSInvceDet->SwapKey (1);
// Navigate through the file using the key 'SID_LNE'
while (pSInvceDet->GetDBStatus () == 0)
{
    // Process record data
    
    pSInvceDet->GetNext ();
}

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

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

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