Venice
Purch::UpdateDetailSel
 
Selectively updates values of an accounting detail in the document.
 
void UpdateDetailSel (
    SHORT sIndex,
    VARIANT vAmountDocC,
    VARIANT vQuantity,
    VARIANT vValue1,
    VARIANT vAccount,
    VARIANT vRemark,
    VARIANT vText1
)
 
Parameters
sIndex
[in] The index of the detail, starting from 0.
vAmountDocC
[in] A VARIANT stating the amount (in document currency) of the detail. The type of this VARIANT determines the action to be taken by the SDK:
Subtype Action
VT_EMPTY Keep the existing value (on disk)
DOUBLE (VT_R8) Use the given value
vQuantity
[in] A VARIANT stating the quantity of the detail. The type of this VARIANT determines the action to be taken by the SDK:
Subtype Action
VT_EMPTY Keep the existing value (on disk)
DOUBLE (VT_R8) Use the given value
vValue1
[in] A VARIANT stating the free value of the detail. The type of this VARIANT determines the action to be taken by the SDK:
Subtype Action
VT_EMPTY Keep the existing value (on disk)
DOUBLE (VT_R8) Use the given value
vAccount
[in] A VARIANT stating the account number of the detail. The type of this VARIANT determines the action to be taken by the SDK:
Subtype Action
VT_EMPTY Keep the existing value (on disk)
BSTR (VT_BSTR) Use the given value
vRemark
[in] A VARIANT stating the remark of the detail. The type of this VARIANT determines the action to be taken by the SDK:
Subtype Action
VT_EMPTY Keep the existing value (on disk)
BSTR (VT_BSTR) Use the given value
vText1
[in] A VARIANT stating the free text of the detail. The type of this VARIANT determines the action to be taken by the SDK:
Subtype Action
VT_EMPTY Keep the existing value (on disk)
BSTR (VT_BSTR) Use the given value
 
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.
If an analytical entry proposal exists for the provided account (parameter bsAccount), the detail is automatically distributed according to this proposal.
How to pass a VARIANT of type VT_EMPTY?
C++
Define a VARIANT and set the type to VT_EMPTY (vEmpty.vt = VT_EMPTY).
Pass this VARIANT.
C#
Pass 'null'.
VBS
Pass 'Empty'.
VB.NET
Pass 'Nothing'.
 
See Also
CreatePurch
Handling accounting documents using the SDK
UpdateDetailSel2
PrepareDocument
GetManualIndex
UpdateDetail
WriteDocument
CancelDocument
 
Samples
 
C++
 
// Update the remark of the first manual detail of the current document to 'Updated via SDK'
short sManualIndex;

pPurch->PrepareDocument (paUpdate);

sManualIndex = pPurch->GetManualIndex ();

if (sManualIndex != -1)
{
    VARIANT vEmpty;
    vEmpty.vt = VT_EMPTY;

    pPurch->UpdateDetailSel (sManualIndex, vEmpty, vEmpty, vEmpty, vEmpty, "Updated via SDK", vEmpty);
}

pPurch->WriteDocument (rmFullReport);

C#
 
// Update the remark of the first manual detail of the current document to 'Updated via SDK'
short sManualIndex;

oPurch.PrepareDocument (ePrepareAction.paUpdate);

sManualIndex = oPurch.GetManualIndex ();

if (sManualIndex != -1)
    oPurch.UpdateDetailSel (sManualIndex, null, null, null, null, "Updated via SDK", null);

oPurch.WriteDocument (eReportMode.rmFullReport);

VBS
 
' Update the remark of the first manual detail of the current document to 'Updated via SDK'
Dim sManualIndex

Call oPurch.PrepareDocument(paUpdate)

sManualIndex = oPurch.GetManualIndex()

If sManualIndex <> -1 Then
    Call oPurch.UpdateDetailSel(sManualIndex, Empty, Empty, Empty, Empty, "Updated via SDK", Empty)
End If

Call oPurch.WriteDocument(rmFullReport)

VB.NET
 
' Update the remark of the first manual detail of the current document to 'Updated via SDK'
Dim sManualIndex As Short

oPurch.PrepareDocument(ePrepareAction.paUpdate)

sManualIndex = oPurch.GetManualIndex()

If sManualIndex <> -1 Then
    oPurch.UpdateDetailSel(sManualIndex, Nothing, Nothing, Nothing, Nothing, "Updated via SDK", Nothing)
End If

oPurch.WriteDocument(eReportMode.rmFullReport)