Venice
Sndry::DeleteAnaDetail
 
Deletes an analytical detail of one accounting detail and analytical type.
 
void DeleteAnaDetail (
    SHORT sAccIndex,
    SHORT sAnaIndex,
    enum eAnaEntType eAnaEntType
)
 
Parameters
sAccIndex
[in] The index of the detail line where the analytical detail line belongs to, starting from 0.
sAnaIndex
[in] The index of the analytical detail line, starting from 0.
eAnaEntType
[in] A value of the 'eAnaEntType' enumeration.
 
Remarks
If the parameter sIndex is an invalid index (refers to a not existing analytical detail) an exception is thrown. You can use GetAnaDetail to check whether an index is valid, in which case it returns true.
 
See Also
CreateSndry
Handling accounting documents using the SDK
PrepareDocument
GetManualIndex
GetNumAnaDetails
WriteDocument
CancelDocument
 
Samples
 
C++
 
// Remove all the analytical centre details of the first manual detail of the current document
short sManualIndex;
bool bWrite = false;

pSndry->PrepareDocument (paUpdate);

sManualIndex = pSndry->GetManualIndex ();

if (sManualIndex != -1)
{
    short sNumAnaDets = pSndry->GetNumAnaDetails (sManualIndex, aetCent);
    
    if (sNumAnaDets != 0)
    {
        for (short sAnaDet = sNumAnaDets - 1; sAnaDet >= 0; sAnaDet--)
        {
            pSndry->DeleteAnaDetail (sManualIndex, sAnaDet, aetCent);
        }
        
        bWrite = true;
    }
}
    
if (bWrite)
    pSndry->WriteDocument (rmFullReport);
else    
    pSndry->CancelDocument ();

C#
 
// Remove all the analytical centre details of the first manual detail of the current document
short sManualIndex;
bool bWrite = false;

oSndry.PrepareDocument (ePrepareAction.paUpdate);

sManualIndex = oSndry.GetManualIndex ();

if (sManualIndex != -1)
{
    short sNumAnaDets = oSndry.GetNumAnaDetails (sManualIndex, eAnaEntType.aetCent);
    
    if (sNumAnaDets != 0)
    {
        for (short sAnaDet = (short)(sNumAnaDets - 1); sAnaDet >= 0; sAnaDet--)
        {
            oSndry.DeleteAnaDetail (sManualIndex, sAnaDet, eAnaEntType.aetCent);
        }
        
        bWrite = true;
    }
}

if (bWrite)
    oSndry.WriteDocument (eReportMode.rmFullReport);
else    
    oSndry.CancelDocument ();

VBS
 
' Remove all the analytical centre details of the first manual detail of the current document
Dim sManualIndex
Dim bWrite

Call oSndry.PrepareDocument(paUpdate)

sManualIndex = oSndry.GetManualIndex()
bWrite = False

If sManualIndex <> -1 Then
    Dim sNumAnaDets, sAnaDet
    
    sNumAnaDets = oSndry.GetNumAnaDetails(sManualIndex, aetCent)
    
    If sNumAnaDets <> 0 Then
        For sAnaDet = sNumAnaDets - 1 To 0 Step -1
            Call oSndry.DeleteAnaDetail(sManualIndex, sAnaDet, aetCent)
        Next
        
        bWrite = True
    End If
End If

If bWrite Then
    Call oSndry.WriteDocument(rmFullReport)
Else
    Call oSndry.CancelDocument()
End If

VB.NET
 
' Remove all the analytical centre details of the first manual detail of the current document
Dim sManualIndex As Short
Dim bWrite As Boolean

oSndry.PrepareDocument(ePrepareAction.paUpdate)

sManualIndex = oSndry.GetManualIndex()
bWrite = True

If sManualIndex <> -1 Then
    Dim sNumAnaDets As Short
    
    sNumAnaDets = oSndry.GetNumAnaDetails(sManualIndex, eAnaEntType.aetCent)
    
    If sNumAnaDets <> 0 Then
        For sAnaDet As Short = sNumAnaDets - 1 To 0 Step -1
            oSndry.DeleteAnaDetail(sManualIndex, sAnaDet, eAnaEntType.aetCent)
        Next
    End If
End If

If bWrite Then
    oSndry.WriteDocument(eReportMode.rmFullReport)
Else
    oSndry.CancelDocument()
End If