SInvce::GetNumStkDetails (Interface: SInvce)
 
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
CreateSInvce
Handling invoicing documents using the SDK
PrepareDocument
CancelDocument
 
Samples
 
C++
 
// Get the number of distributions of the first detail of the current document
pSInvce->PrepareDocument (paView);

short sNumStkDets = pSInvce->GetNumStkDetails (0);

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

pSInvce->CancelDocument ();

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

short sNumStkDets = oSInvce.GetNumStkDetails (0);

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

oSInvce.CancelDocument ();

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

Call oSInvce.PrepareDocument(paView)

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

Call oSInvce.CancelDocument()

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

oSInvce.PrepareDocument(ePrepareAction.paView)

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

oSInvce.CancelDocument()