Show / Hide Table of Contents

Interface IImportAgent

Interface for the Import Agent This agent can be used to import data into the system

Namespace: SuperOffice.CRM.Services
Assembly: SuperOffice.Services.dll
Syntax
[Agent("Import Agent", "Interface for the Import Agent. This agent can be used to import data into the system")]
public interface IImportAgent : IAgent
Examples
  using SuperOffice;
  using SuperOffice.CRM.Services;

  using (SoSession mySession = SoSession.Authenticate("user", "pass"))
  {
     using (ImportAgent agent = new ImportAgent())
     {
        // call methods on agent here...
     }
  }

Methods

CreateDefaultImportLine(Int32)

Create a new empty import row with x count of values

Declaration
ImportLine CreateDefaultImportLine(int countColumns)
Parameters
Type Name Description
Int32 countColumns

The count of values that will can be filled out

Returns
Type Description
ImportLine

A new ImportLine

Examples
  using SuperOffice;
  using SuperOffice.CRM.Services;

  using (SoSession mySession = SoSession.Authenticate("user", "pass"))
  {
     using (ImportAgent agent = new ImportAgent())
     {
        // call methods on agent here...
     }
  }

CreateErpImportData(ArchiveRestrictionInfo[], String[], Int32, ErpActorType)

Populates the ImportLines and columnDefs basedfrom erp system

Declaration
ImportErpData CreateErpImportData(ArchiveRestrictionInfo[] restriction, string[] columns, int connectionId, ErpActorType erpActorType)
Parameters
Type Name Description
ArchiveRestrictionInfo[] restriction

Archive restrictions.

String[] columns

Columns.

Int32 connectionId

Connection id for Erp system

ErpActorType erpActorType

Erp Actor type

Returns
Type Description
ImportErpData

The ImportLines and ColumnDefs

Examples
  using SuperOffice;
  using SuperOffice.CRM.Services;

  using (SoSession mySession = SoSession.Authenticate("user", "pass"))
  {
     using (ImportAgent agent = new ImportAgent())
     {
        // call methods on agent here...
     }
  }

PreviewImport(ImportLine[], String[], String, String)

Preview the import

Declaration
ImportLine[] PreviewImport(ImportLine[] importLines, string[] columnDefinition, string culture, string context)
Parameters
Type Name Description
ImportLine[] importLines

The rows that will be manipulated and according to Import rules

String[] columnDefinition

An array of the columndefinitions, like firstname, lastname, ...

String culture

The current culture used in the import. Used to match language specific strings

String context

Optional context for the import.

Returns
Type Description
ImportLine[]

An array of the the rows that can be imported, manipulated according to Import rules given

Examples
  using SuperOffice;
  using SuperOffice.CRM.Services;

  using (SoSession mySession = SoSession.Authenticate("user", "pass"))
  {
     using (ImportAgent agent = new ImportAgent())
     {
        // call methods on agent here...
     }
  }

SaveImport(ImportLine[], String[], Boolean, String, String)

Do the actual import

Declaration
int[] SaveImport(ImportLine[] importLines, string[] columnDefinition, bool createSelection, string culture, string context)
Parameters
Type Name Description
ImportLine[] importLines

The rows that will be imported

String[] columnDefinition

An array of the columndefinitions, like firstname, lastname, ...

Boolean createSelection

true if a selection of the imported entities shall be made

String culture

The current culture used in the import. Used to match language specific strings

String context

Optional context for the import.

Returns
Type Description
Int32[]

First part: the id of the selection created after the import, 0 if no selection is created. Second part: The number of rows actually imported

Examples
  using SuperOffice;
  using SuperOffice.CRM.Services;

  using (SoSession mySession = SoSession.Authenticate("user", "pass"))
  {
     using (ImportAgent agent = new ImportAgent())
     {
        // call methods on agent here...
     }
  }
© SuperOffice. All rights reserved.
SuperOffice |  Community |  Release Notes |  Privacy |  Site feedback |  Search Docs |  About Docs |  Contribute |  Back to top