Venice
Purch::UpdateDetailSel2
 
Selectively updates values of an extended accounting detail in the document.
 
void UpdateDetailSel2 (
    SHORT sIndex,
    VARIANT vAmountDocC,
    VARIANT vQuantity,
    VARIANT vValue1,
    VARIANT vAccount,
    VARIANT vRemark,
    VARIANT vText1,
    VARIANT vInterCompany,
    VARIANT vCutOffAccount,
    VARIANT vCutOffStart,
    VARIANT vCutOffEnd
)
 
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
vInterCompany
[in] A VARIANT stating the inter-company flag 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)
BOOLEAN (VT_BOOL) Use the given value
vCutOffAccount
[in] A VARIANT stating the cut off 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
vCutOffStart
[in] A VARIANT stating the cut off start date 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)
DATE (VT_DATE) Use the given value
vCutOffEnd
[in] A VARIANT stating the cut off end date 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)
DATE (VT_DATE) 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
UpdateDetailSel
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->UpdateDetailSel2 (sManualIndex, vEmpty, vEmpty, vEmpty, vEmpty, "Updated via SDK", vEmpty, vEmpty, vEmpty, vEmpty, 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.UpdateDetailSel2 (sManualIndex, null, null, null, null, "Updated via SDK", null, null, null, null, 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.UpdateDetailSel2(sManualIndex, Empty, Empty, Empty, Empty, "Updated via SDK", Empty, Empty, Empty, Empty, 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.UpdateDetailSel2(sManualIndex, Nothing, Nothing, Nothing, Nothing, "Updated via SDK", Nothing, Nothing, Nothing, Nothing, Nothing)
End If

oPurch.WriteDocument(eReportMode.rmFullReport)