|
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 |
|
|
|
Samples |
|
|
C++ |
|
// Delete the detail with remark = 'Remove this line!' of the current proposal
VARIANT vRemark;
short sNumDets;
bool bNext = true, bWrite = false;
pAccProp->PrepareProposal (paUpdate);
sNumDets = pAccProp->GetNumDetails ();
for (short sDetail = 0; bNext && sDetail < sNumDets; sDetail++)
{
if (pAccProp->GetDetail (sDetail, NULL, NULL, NULL, NULL, &vRemark, NULL) && CString (vRemark.bstrVal) == "Remove this line!")
{
pAccProp->DeleteDetail (sDetail);
bWrite = true;
bNext = false;
}
}
if (bWrite)
pAccProp->WriteProposal (rmFullReport);
else
pAccProp->CancelProposal ();
|
|
|
C# |
|
// Delete the detail with remark = 'Remove this line!' of the current proposal
object oRemark, oDummy;
short sNumDets;
bool bNext = true, bWrite = false;
oAccProp.PrepareProposal (ePrepareAction.paUpdate);
sNumDets = oAccProp.GetNumDetails ();
for (short sDetail = 0; bNext && sDetail < sNumDets; sDetail++)
{
if (oAccProp.GetDetail (sDetail, out oDummy, out oDummy, out oDummy, out oDummy, out oRemark, out oDummy) && oRemark.ToString () == "Remove this line!")
{
oAccProp.DeleteDetail (sDetail);
bWrite = true;
bNext = false;
}
}
if (bWrite)
oAccProp.WriteProposal (eReportMode.rmFullReport);
else
oAccProp.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 oAccProp.PrepareProposal(paUpdate)
sNumDets = oAccProp.GetNumDetails()
For sDetail = 0 To sNumDets - 1
If oAccProp.GetDetail(sDetail, oDummy, oDummy, oDummy, oDummy, oRemark, oDummy) And oRemark = "Remove this line!" Then
Call oAccProp.DeleteDetail(sDetail)
bWrite = True
Exit For
End If
Next
If bWrite Then
Call oAccProp.WriteProposal(rmFullReport)
Else
Call oAccProp.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
bWrite = False
oAccProp.PrepareProposal(ePrepareAction.paUpdate)
sNumDets = oAccProp.GetNumDetails()
For sDetail As Short = 0 To sNumDets - 1
If oAccProp.GetDetail(sDetail, oDummy, oDummy, oDummy, oDummy, oRemark, oDummy) And oRemark = "Remove this line!" Then
oAccProp.DeleteDetail(sDetail)
bWrite = True
Exit For
End If
Next
If bWrite Then
oAccProp.WriteProposal(eReportMode.rmFullReport)
Else
oAccProp.CancelProposal()
End If
|
|