SOrder::GetNumStkDetails (Interface: SOrder)
 
Gets the number of distributions for a detail.
 
SHORT GetNumStkDetails (
    SHORT sDetIndex
)
 
Parameters
sDetIndex
[in] The index of the detail where the distribution belongs to, starting from 0.
 
Return value
A SHORT containing the number of distributions of the given detail of the current document.
 
Remarks
If the option 'Stock management' nor the option 'Serial numbers' is active in the dossier, this method returns 0.
 
See Also
CreateSOrder
Handling invoicing documents using the SDK
PrepareDocument
CancelDocument
 
Samples
 
C++
 
// Get the number of distributions of the first detail of the current document
pSOrder->PrepareDocument (paView);

short sNumStkDets = pSOrder->GetNumStkDetails (0);

if (sNumStkDets != 0)
{
    // Process data
}

pSOrder->CancelDocument ();

C#
 
// Get the number of distributions of the first detail of the current document
oSOrder.PrepareDocument (ePrepareAction.paView);

short sNumStkDets = oSOrder.GetNumStkDetails (0);

if (sNumStkDets != 0)
{
    // Process data
}

oSOrder.CancelDocument ();

VBS
 
' Get the number of distributions of the first detail of the current document
Dim sNumStkDets

Call oSOrder.PrepareDocument(paView)

sNumStkDets = oSOrder.GetNumStkDetails(0)
    
If sNumStkDets <> 0 Then
    ' Process data
End If

Call oSOrder.CancelDocument()

VB.NET
 
' Get the number of distributions of the first detail of the current document
Dim sNumStkDets As Short

oSOrder.PrepareDocument(ePrepareAction.paView)

sNumStkDets = oSOrder.GetNumStkDetails(0)
    
If sNumStkDets <> 0 Then
    ' Process data
End If

oSOrder.CancelDocument()