Venice
Sales::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
CreateSales
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;

pSales->PrepareDocument (paUpdate);

sManualIndex = pSales->GetManualIndex ();

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

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

pSales->WriteDocument (rmFullReport);

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

oSales.PrepareDocument (ePrepareAction.paUpdate);

sManualIndex = oSales.GetManualIndex ();

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

oSales.WriteDocument (eReportMode.rmFullReport);

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

Call oSales.PrepareDocument(paUpdate)

sManualIndex = oSales.GetManualIndex()

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

Call oSales.WriteDocument(rmFullReport)

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

oSales.PrepareDocument(ePrepareAction.paUpdate)

sManualIndex = oSales.GetManualIndex()

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

oSales.WriteDocument(eReportMode.rmFullReport)