Dossier::BeginTransactionalImport (Interface: Dossier)
 
Starts a transaction for multiple imports.
 
void BeginTransactionalImport ()
 
Remarks
It is important to keep the period between starting and ending the transactional import as short as possible. During this transaction none of the files involved can be modified by other users. It is therefore adviseable to not show any user interface during the transactional import.
This method can be only be used for objects of the same dossier!
None of the imported items will be available in the files as long as the transactional import is busy. It is only after the transaction is completed that all (or none) of the items are visible in the files.
 
See Also
CreateDossierContext
EndTransactionalImport
Custm.Import
Sales.Import
 
Samples
 
C++
 
// Import customers and their sales documents in one transaction
VARIANT vImported, vErrMsg;

pDossier->BeginTransactionalImport ();
    if (pCustm->Import ("C:\\Import\\Desc\\Custm.cli", "C:\\Import\\Data\\Custm.txt", 0, VARIANT_TRUE, VARIANT_FALSE, VARIANT_FALSE, &vImported, &vErrMsg))
        pSales->Import ("C:\\Import\\Desc\\Sales.cli", "C:\\Import\\Data\\Sales.txt", 0, VARIANT_TRUE, VARIANT_FALSE, VARIANT_FALSE, &vImported, &vErrMsg);
pDossier->EndTransactionalImport (VARIANT_TRUE);

// Messages with user interface can be given here...

C#
 
// Import customers and their sales documents in one transaction
object oImported, oErrMsg;

oDossier.BeginTransactionalImport ();
    if (oCustm.Import (@"C:\Import\Desc\Custm.cli", @"C:\Import\Data\Custm.txt", 0, true, false, false, out oImported, out oErrMsg))
        oSales.Import (@"C:\Import\Desc\Sales.cli", @"C:\Import\Data\Sales.txt", 0, true, false, false, out oImported, out oErrMsg);
oDossier.EndTransactionalImport (true);

// Messages with user interface can be given here...

VBS
 
' Import customers and their sales documents in one transaction
Dim oImported, oErrMsg

Call oDossier.BeginTransactionalImport()
    If oCustm.Import("C:\Import\Desc\Custm.cli", "C:\Import\Data\Custm.txt", 0, True, False, False, oImported, oErrMsg) Then
        oSales.Import("C:\Import\Desc\Sales.cli", "C:\Import\Data\Sales.txt", 0, True, False, False, oImported, oErrMsg)
    End If
Call oDossier.EndTransactionalImport(True)

' Messages with user interface can be given here...

VB.NET
 
' Import customers and their sales documents in one transaction
Dim oImported, oErrMsg As Object

oDossier.BeginTransactionalImport()    
    If oCustm.Import("C:\Import\Desc\Custm.cli", "C:\Import\Data\Custm.txt", 0, True, False, False, oImported, oErrMsg) Then
        oSales.Import("C:\Import\Desc\Sales.cli", "C:\Import\Data\Sales.txt", 0, True, False, False, oImported, oErrMsg)
    End If
oDossier.EndTransactionalImport(True)

' Messages with user interface can be given here...