Sndry::UpdateDetailSel2 (Interface: Sndry)
 
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 vAmountDetC,
    VARIANT vDetC,
    VARIANT vTickSysNum,
    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
vAmountDetC
[in] A VARIANT stating the amount (in detail 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
vDetC
[in] A VARIANT stating the 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)
BSTR (VT_BSTR) Use the given value
vTickSysNum
[in] A VARIANT stating the system number of the detail that is ticked by this line (0 if nothing is ticked). The type of this VARIANT determines the action to be taken by the SDK:
Subtype Action
VT_EMPTY Keep the existing value (on disk)
LONG (VT_I4) 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
CreateSndry
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;

pSndry->PrepareDocument (paUpdate);

sManualIndex = pSndry->GetManualIndex ();

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

    pSndry->UpdateDetailSel2 (sManualIndex, vEmpty, vEmpty, vEmpty, vEmpty, "Updated via SDK", vEmpty, vEmpty, vEmpty, vEmpty, vEmpty, vEmpty, vEmpty, vEmpty);
}

pSndry->WriteDocument (rmFullReport);

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

oSndry.PrepareDocument (ePrepareAction.paUpdate);

sManualIndex = oSndry.GetManualIndex ();

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

oSndry.WriteDocument (eReportMode.rmFullReport);

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

Call oSndry.PrepareDocument(paUpdate)

sManualIndex = oSndry.GetManualIndex()

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

Call oSndry.WriteDocument(rmFullReport)

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

oSndry.PrepareDocument(ePrepareAction.paUpdate)

sManualIndex = oSndry.GetManualIndex()

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

oSndry.WriteDocument(eReportMode.rmFullReport)