SOrder::GetStkDetail (Interface: SOrder)
 
Gets a distribution of a detail.
 
VARIANT_BOOL GetStkDetail (
    SHORT sDetIndex,
    SHORT sStkIndex,
    VARIANT* pvQuantity,
    VARIANT* pvLocation,
    VARIANT* pvSerialNumber
)
 
Parameters
sDetIndex
[in] The index of the detail where the distribution belongs to, starting from 0.
sStkIndex
[in] The index of the distribution, starting from 0.
pvQuantity
[out] Returns a VARIANT, subtype DOUBLE, containing the quantity that is distributed.
pvLocation
[out] Returns a VARIANT, subtype BSTR, containing the location of the article.
pvSerialNumber
[out] Returns a VARIANT, subtype BSTR, containing the serial number of the article.
 
Return value
True if the distribution with the given index exists, otherwise false.
 
See Also
CreateSOrder
Handling invoicing documents using the SDK
PrepareDocument
GetNumDetails
GetNumStkDetails
CancelDocument
 
Samples
 
C++
 
// Retrieve all distributions of all details of the current document
VARIANT vQuantity, vLocation, vSerialNumber;
short sNumDetails, sNumStkDets;

pSOrder->PrepareDocument (paView);

sNumDetails = pSOrder->GetNumDetails ();

for (short sDetail = 0; sDetail < sNumDetails; sDetail++)
{
    sNumStkDets = pSOrder->GetNumStkDetails (sDetail);
    
    for (short sStkDet = 0; sStkDet < sNumStkDets; sStkDet++)
    {
        if (pSOrder->GetStkDetail (sDetail, sStkDet, &vQuantity, &vLocation, &vSerialNumber))
        {
            // Process data
        }
    }
}

pSOrder->CancelDocument ();

C#
 
// Retrieve all distributions of all details of the current document
object oQuantity, oLocation, oSerialNumber;
short sNumDetails, sNumStkDets;

oSOrder.PrepareDocument (ePrepareAction.paView);

sNumDetails = oSOrder.GetNumDetails ();

for (short sDetail = 0; sDetail < sNumDetails; sDetail++)
{
    sNumStkDets = oSOrder.GetNumStkDetails (sDetail);
    
    for (short sStkDet = 0; sStkDet < sNumStkDets; sStkDet++)
    {
        if (oSOrder.GetStkDetail (sDetail, sStkDet, out oQuantity, out oLocation, out oSerialNumber))
        {
            // Process data
        }
    }
}

oSOrder.CancelDocument ();

VBS
 
' Retrieve all distributions of all details of the current document
Dim oQuantity, oLocation, oSerialNumber
Dim sDetail, sStkDet, sNumDetails, sNumStkDets

Call oSOrder.PrepareDocument(paView)

sNumDetails = oSOrder.GetNumDetails()

For sDetail = 0 To sNumDetails - 1
    sNumStkDets = oSOrder.GetNumStkDetails(sDetail)
    
    For sStkDet = 0 To sNumStkDets - 1
        If oSOrder.GetStkDetail(sDetail, sStkDet, oQuantity, oLocation, oSerialNumber) Then
            ' Process data
        End If
    Next
Next

Call oSOrder.CancelDocument()

VB.NET
 
' Retrieve all distributions of all details of the current document
Dim oQuantity, oLocation, oSerialNumber As Object
Dim sNumDetails, sNumStkDets As Short

oSOrder.PrepareDocument(ePrepareAction.paView)

sNumDetails = oSOrder.GetNumDetails()

For sDetail As Short = 0 To sNumDetails - 1
    sNumStkDets = oSOrder.GetNumStkDetails(sDetail)
    
    For sStkDet As Short = 0 To sNumStkDets - 1
        If oSOrder.GetStkDetail(sDetail, sStkDet, oQuantity, oLocation, oSerialNumber) Then
            ' Process data            
        End If
    Next
Next

oSOrder.CancelDocument()