Venice
AnaProp::DeleteDetail
 
Deletes an accounting detail from the proposal.
 
void DeleteDetail (
    SHORT sIndex
)
 
Parameters
sIndex
[in] The index of the detail, starting from 0.
 
Remarks
If the parameter sIndex is an invalid index (refers to a not existing detail) an exception is thrown. You can use GetDetail to check whether an index is valid, in which case it returns true.
 
See Also
CreateAnaProp
Handling analytical accounting proposals using the SDK
PrepareProposal
GetNumDetails
GetDetail
WriteProposal
CancelProposal
 
Samples
 
C++
 
// Delete the detail with remark = 'Remove this line!' of the current proposal
VARIANT vRemark;
short sNumDets;
bool bNext = true, bWrite = false;

pAnaProp->PrepareProposal (paUpdate);

sNumDets = pAnaProp->GetNumDetails ();

for (short sDetail = 0; bNext && sDetail < sNumDets; sDetail++)
{
    if (pAnaProp->GetDetail (sDetail, NULL, NULL, NULL, NULL, &vRemark, NULL) && CString (vRemark.bstrVal) == "Remove this line!")
    {
        pAnaProp->DeleteDetail (sDetail);
        bWrite = true;
        bNext = false;
    }
}

if (bWrite)
    pAnaProp->WriteProposal (rmFullReport);
else
    pAnaProp->CancelProposal ();

C#
 
// Delete the detail with remark = 'Remove this line!' of the current proposal
object oRemark, oDummy;
short sNumDets;
bool bNext = true, bWrite = false;

oAnaProp.PrepareProposal (ePrepareAction.paUpdate);

sNumDets = oAnaProp.GetNumDetails ();

for (short sDetail = 0; bNext && sDetail < sNumDets; sDetail++)
{
    if (oAnaProp.GetDetail (sDetail, out oDummy, out oDummy, out oDummy, out oDummy, out oRemark, out oDummy) && oRemark.ToString () == "Remove this line!")
    {
        oAnaProp.DeleteDetail (sDetail);
        bWrite = true;
        bNext = false;
    }
}

if (bWrite)
    oAnaProp.WriteProposal (eReportMode.rmFullReport);
else
    oAnaProp.CancelProposal ();

VBS
 
' Delete the detail with remark = 'Remove this line!' of the current proposal
Dim oRemark, oDummy
Dim sDetail, sNumDets
Dim bWrite

bWrite = False

Call oAnaProp.PrepareProposal(paUpdate)

sNumDets = oAnaProp.GetNumDetails()

For sDetail = 0 To sNumDets - 1
    If oAnaProp.GetDetail(sDetail, oDummy, oDummy, oDummy, oDummy, oRemark, oDummy) And oRemark = "Remove this line!" Then
        Call oAnaProp.DeleteDetail(sDetail)
        bWrite = True
        Exit For
    End If
Next

If bWrite Then
    Call oAnaProp.WriteProposal(rmFullReport)
Else
    Call oAnaProp.CancelProposal()
End If

VB.NET
 
' Delete the detail with remark = 'Remove this line!' of the current proposal
Dim oRemark, oDummy As Object
Dim sNumDets As Short
Dim bWrite As Boolean

oDummy = Nothing
oRemark = Nothing

bWrite = False

oAnaProp.PrepareProposal(ePrepareAction.paUpdate)

sNumDets = oAnaProp.GetNumDetails()

For sDetail As Short = 0 To sNumDets - 1
    If oAnaProp.GetDetail(sDetail, oDummy, oDummy, oDummy, oDummy, oRemark, oDummy) And oRemark = "Remove this line!" Then
        oAnaProp.DeleteDetail(sDetail)
        bWrite = True
        Exit For
    End If
Next

If bWrite Then
    oAnaProp.WriteProposal(eReportMode.rmFullReport)
Else
    oAnaProp.CancelProposal()
End If