Show / Hide Table of Contents

Interface IErpSyncAgent

Interface for the ErpSync Agent Services for the ERP Integration Services feature

Online Restricted: This agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.
Namespace: SuperOffice.CRM.Services
Assembly: SuperOffice.Services.dll
Syntax
[Agent("ErpSync Agent", "Interface for the ErpSync Agent. Services for the ERP Integration Services feature")]
public interface IErpSyncAgent : IAgent
Examples
using SuperOffice;
using SuperOffice.CRM.Services;

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

Methods

BreakActorLinkAsync(int, int, CrmActorType, CancellationToken)

Remove the link between a CRM entity and an ERP entity

Online Restricted: The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.
Declaration
Task<bool> BreakActorLinkAsync(int erpConnectionId, int crmRecordId, CrmActorType crmActorType, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int erpConnectionId

The ERP connection ID

int crmRecordId

The ID of the CRM entity to connect to

CrmActorType crmActorType

Identifies the CRM actor type corresponding to this CRM entity

CancellationToken cancellationToken
Returns
Type Description
Task<bool>

True if success

CanDeleteErpSyncConnectorEntityAsync(int, CancellationToken)

Can we delete the connector?

Online Restricted: The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.
Declaration
Task<ErpSyncResponseCode> CanDeleteErpSyncConnectorEntityAsync(int erpSyncConnectorId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int erpSyncConnectorId

The ID of the ErpSync connector to check if can be deleted

CancellationToken cancellationToken
Returns
Type Description
Task<ErpSyncResponseCode>

Enum response says ok or what is wrong

ChangeEngineIntervalAsync(TimeSpan, CancellationToken)

Change the interval for each run of the Sync Engine

Online Restricted: The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.
Declaration
Task ChangeEngineIntervalAsync(TimeSpan interval, CancellationToken cancellationToken = default)
Parameters
Type Name Description
TimeSpan interval

The run interval for the engine

CancellationToken cancellationToken
Returns
Type Description
Task

ChangeEngineStatusAsync(bool, CancellationToken)

Change the current running/stopped status of the Sync engine

Online Restricted: The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.
Declaration
Task<ErpSyncEngineStatus> ChangeEngineStatusAsync(bool run, CancellationToken cancellationToken = default)
Parameters
Type Name Description
bool run

If true, then start the engine; otherwise stop it (requests to the Batch system, may not be immediately reflected)

CancellationToken cancellationToken
Returns
Type Description
Task<ErpSyncEngineStatus>

The current status of the engine

ConnectActorAsync(int, int, CrmActorType, string, ErpActorType, ErpSyncFieldValue[], CancellationToken)

Create a link between Erp and Crm and set default values

Online Restricted: The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.
Declaration
Task ConnectActorAsync(int erpConnectionId, int crmRecordId, CrmActorType crmActorType, string erpKey, ErpActorType erpActorType, ErpSyncFieldValue[] fieldValues, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int erpConnectionId

ErpConnectionId

int crmRecordId

CrmRecordId

CrmActorType crmActorType

The Crm Actor type

string erpKey
ErpActorType erpActorType

The Erp Actor type

ErpSyncFieldValue[] fieldValues

The Crm Fields

CancellationToken cancellationToken
Returns
Type Description
Task

CreateActorLinkAsync(int, int, CrmActorType, string, ErpActorType, CancellationToken)

Link a crm entity to an erp entity

Online Restricted: The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.
Declaration
Task<bool> CreateActorLinkAsync(int erpConnectionId, int crmRecordId, CrmActorType crmActorType, string erpKey, ErpActorType erpActorType, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int erpConnectionId

The ERP connection ID

int crmRecordId

The ID of the CRM entity to connect to

CrmActorType crmActorType

Identifies the CRM actor type corresponding to this CRM entity

string erpKey

The ERP entity identifier

ErpActorType erpActorType

The ERP actor type

CancellationToken cancellationToken
Returns
Type Description
Task<bool>

True if success

CreateDefaultErpSyncConnectorEntityAsync(CancellationToken)

Loading default values into a new ErpSyncConnectorEntity.

Online Restricted: The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.
Declaration
Task<ErpSyncConnectorEntity> CreateDefaultErpSyncConnectorEntityAsync(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
Task<ErpSyncConnectorEntity>

New ErpSyncConnectorEntity with default values

CreateErpActorFromCrmAsync(int, int, ErpActorType, CrmActorType, StringDictionary, CancellationToken)

Create ErpActor from crm entity

Online Restricted: The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.
Declaration
Task<bool> CreateErpActorFromCrmAsync(int connectionId, int crmEntityId, ErpActorType erpActorType, CrmActorType crmActorType, StringDictionary erpFieldKeyValues, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int connectionId

The connection ID

int crmEntityId

The ID of the CRM entity to create an ERP actor from

ErpActorType erpActorType

The ERP actor type

CrmActorType crmActorType

The CRM actor type

StringDictionary erpFieldKeyValues

A map of matching erp field keys and values to set for the new erp entity

CancellationToken cancellationToken
Returns
Type Description
Task<bool>

Created ERP actor with success

DeleteConnectionAsync(int, CancellationToken)

Deletes a connection from the database.

Online Restricted: The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.
Declaration
Task DeleteConnectionAsync(int erpConnectionId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int erpConnectionId

Primary key of the connection

CancellationToken cancellationToken
Returns
Type Description
Task

A void return

DeleteErpSyncConnectorEntityAsync(int, CancellationToken)

Deletes the ErpSyncConnectorEntity

Online Restricted: The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.
Declaration
Task DeleteErpSyncConnectorEntityAsync(int erpSyncConnectorEntityId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int erpSyncConnectorEntityId

The identity of the ErpSyncConnectorEntity

CancellationToken cancellationToken
Returns
Type Description
Task

This method has no return value

ForceResyncAsync(int, int[], CancellationToken)

Force resync from CRM or given Erp connection to all other connections

Online Restricted: The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.
Declaration
Task<PluginResponse> ForceResyncAsync(int erpConnectionId, int[] internalKeyIds, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int erpConnectionId

If positive, resync from the given erp connection

int[] internalKeyIds

The internal keys of the entities to resync, or empty to resync all

CancellationToken cancellationToken
Returns
Type Description
Task<PluginResponse>

The response

ForceResyncBatchTaskAsync(int, int[], CancellationToken)

Start batch task to force resync from CRM or given Erp connection to all other connections

Online Restricted: The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.
Declaration
Task ForceResyncBatchTaskAsync(int erpConnectionId, int[] internalKeyIds, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int erpConnectionId

If positive, resync from the given erp connection

int[] internalKeyIds

The internal keys of the entities to resync, or empty to resync all

CancellationToken cancellationToken
Returns
Type Description
Task

ForceResyncExternalAsync(int, ErpActorType, string[], CancellationToken)

Force resync from CRM or given Erp connection to all other connections, using external keys

Online Restricted: The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.
Declaration
Task<PluginResponse> ForceResyncExternalAsync(int erpConnectionId, ErpActorType erpActorType, string[] externalKeys, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int erpConnectionId

Resync from the given erp connection

ErpActorType erpActorType

Which actor type the external keys are associated with

string[] externalKeys

The internal keys of the entities to resync, or empty to resync all

CancellationToken cancellationToken
Returns
Type Description
Task<PluginResponse>

The response

ForceResyncExternalNoBlankValuesAsync(int, ErpActorType, string[], CancellationToken)

Force resync from CRM or given Erp connection to all other connections, using external keys, and tell the sync that you don't want blank values to overwrite non-blank values. Useful on import.

Online Restricted: The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.
Declaration
Task<PluginResponse> ForceResyncExternalNoBlankValuesAsync(int erpConnectionId, ErpActorType erpActorType, string[] externalKeys, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int erpConnectionId

Resync from the given erp connection

ErpActorType erpActorType

Which actor type the external keys are associated with

string[] externalKeys

The internal keys of the entities to resync, or empty to resync all

CancellationToken cancellationToken
Returns
Type Description
Task<PluginResponse>

The response

ForceResyncNoBlankValuesAsync(int, int[], CancellationToken)

Force resync from CRM or given Erp connection to all other connections and tell the sync that you don't want blank values to overwrite non-blank values. Useful on import.

Online Restricted: The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.
Declaration
Task<PluginResponse> ForceResyncNoBlankValuesAsync(int erpConnectionId, int[] internalKeyIds, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int erpConnectionId

If positive, resync from the given erp connection

int[] internalKeyIds

The internal keys of the entities to resync, or empty to resync all

CancellationToken cancellationToken
Returns
Type Description
Task<PluginResponse>

The response

ForceSyncAllAsync(CancellationToken)

Sync all active connections even when automatic sync is off

Online Restricted: The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.
Declaration
Task<PluginResponse> ForceSyncAllAsync(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
Task<PluginResponse>

The response

GetActorTypeMappingAsync(int, ErpActorType, CancellationToken)

Get the current mappings for one connection/actor; connection+actor type = unique key

Online Restricted: The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.
Declaration
Task<ErpSyncActorTypeMapping> GetActorTypeMappingAsync(int erpConnectionId, ErpActorType actorType, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int erpConnectionId

The ERP connection ID

ErpActorType actorType

The actor type

CancellationToken cancellationToken
Returns
Type Description
Task<ErpSyncActorTypeMapping>

The current mapping from the database

GetAllConnectionsAsync(bool, CancellationToken)

Returns all ERP Sync connections without config field data. Uses the ErpConnection archive.

Online Restricted: The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.
Declaration
Task<ErpConnection[]> GetAllConnectionsAsync(bool includeDeleted, CancellationToken cancellationToken = default)
Parameters
Type Name Description
bool includeDeleted

Include deleted connections in the result?

CancellationToken cancellationToken
Returns
Type Description
Task<ErpConnection[]>

The connection id, name, description

GetAllConnectorsAsync(CancellationToken)

Returns all ERP Sync connectors. Uses the ErpConnector archive.

Online Restricted: The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.
Declaration
Task<ListItem[]> GetAllConnectorsAsync(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
Task<ListItem[]>

The connector id, name, url

GetConfigurationFieldsAsync(int, CancellationToken)

Returns all fields needed to connect to the given connector

Online Restricted: The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.
Declaration
Task<FieldMetadata[]> GetConfigurationFieldsAsync(int erpConnectorId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int erpConnectorId

The id of the erp connector

CancellationToken cancellationToken
Returns
Type Description
Task<FieldMetadata[]>

The fields

GetConnectionAsync(int, CancellationToken)

Returns the specified connection.

Online Restricted: The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.
Declaration
Task<ErpConnection> GetConnectionAsync(int erpConnectionId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int erpConnectionId

Primary key of the connection

CancellationToken cancellationToken
Returns
Type Description
Task<ErpConnection>

The connection

GetConnectionListMappingsAsync(int, CancellationToken)

Returns the listmappings for the specified connection.

Online Restricted: The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.
Declaration
Task<ErpConnectionListMappingContainer> GetConnectionListMappingsAsync(int erpConnectionId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int erpConnectionId

Primary key of the connection

CancellationToken cancellationToken
Returns
Type Description
Task<ErpConnectionListMappingContainer>

The listmappings

GetConnectionsAndDisplayFieldsAsync(CrmActorType, int, CancellationToken)

Get all connection statuses and fields for a given entity

Online Restricted: The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.
Declaration
Task<ErpConnectionData[]> GetConnectionsAndDisplayFieldsAsync(CrmActorType crmActorType, int entityId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
CrmActorType crmActorType

The type of the CRM entity

int entityId

The id of the entity

CancellationToken cancellationToken
Returns
Type Description
Task<ErpConnectionData[]>

An array of ErpConnectionData carriers

GetCrmActorTypeAsync(int, ErpActorType, CancellationToken)

Retrieves the CrmActorType that are mapped to a specific ErpActorType for this connection

Online Restricted: The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.
Declaration
Task<CrmActorType> GetCrmActorTypeAsync(int erpConnectionId, ErpActorType erpActorType, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int erpConnectionId

The ERP connection ID

ErpActorType erpActorType

The ERP actor type

CancellationToken cancellationToken
Returns
Type Description
Task<CrmActorType>

The CrmActorType

GetDefaultValueInfoAsync(int, CancellationToken)

Get information about default value for an ERP field

Online Restricted: The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.
Declaration
Task<ErpSyncDefaultValue> GetDefaultValueInfoAsync(int erpFieldId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int erpFieldId

The id of the ERP field

CancellationToken cancellationToken
Returns
Type Description
Task<ErpSyncDefaultValue>

Object with information about default values

GetEngineStatusAsync(CancellationToken)

Get the current status of the Sync engine

Online Restricted: The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.
Declaration
Task<ErpSyncEngineStatus> GetEngineStatusAsync(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
Task<ErpSyncEngineStatus>

The current status of the engine

GetErpConnectionConfigFieldsAsync(int, CancellationToken)

Returns the config fields for the connection.

Online Restricted: The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.
Declaration
Task<StringDictionary> GetErpConnectionConfigFieldsAsync(int erpConnectionId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int erpConnectionId

Primary key of the erp connection

CancellationToken cancellationToken
Returns
Type Description
Task<StringDictionary>

Config Fields

GetErpFieldValuesAsync(int, CrmActorType, int, string[], CancellationToken)

Get the values for the specified fields from the ERP connection

Online Restricted: The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.
Declaration
Task<string[]> GetErpFieldValuesAsync(int erpConnectionId, CrmActorType crmActorType, int entityId, string[] fieldKeys, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int erpConnectionId

The id of the connection

CrmActorType crmActorType

The type of the CRM entity

int entityId

The id of the entity

string[] fieldKeys

The fields for which you want to get the values

CancellationToken cancellationToken
Returns
Type Description
Task<string[]>

An array containing the values for the specified fields, in the same order

GetErpSyncConnectionSummaryAsync(int, CancellationToken)

Get a summary of the current ErpSync configuration/setup

Online Restricted: The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.
Declaration
Task<ErpSyncConnectionSummary> GetErpSyncConnectionSummaryAsync(int erpSyncConnectionId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int erpSyncConnectionId

The ID of the ErpSync connection for which information is sought

CancellationToken cancellationToken
Returns
Type Description
Task<ErpSyncConnectionSummary>

Summary of connection information, and one summary element per configured actor type

GetErpSyncConnectorEntityAsync(int, CancellationToken)

Gets a ErpSyncConnectorEntity object.

Online Restricted: The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.
Declaration
Task<ErpSyncConnectorEntity> GetErpSyncConnectorEntityAsync(int erpSyncConnectorEntityId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int erpSyncConnectorEntityId

The identifier of the ErpSyncConnectorEntity object

CancellationToken cancellationToken
Returns
Type Description
Task<ErpSyncConnectorEntity>

A single ErpSyncConnectorEntity

GetFieldValuesFromCrmAsync(int, CrmActorType, CancellationToken)

Get Crm Field values

Online Restricted: The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.
Declaration
Task<ErpSyncFieldValue[]> GetFieldValuesFromCrmAsync(int recordId, CrmActorType actorTypeCrm, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int recordId

The id of the CRM entity

CrmActorType actorTypeCrm

CRM Actor type

CancellationToken cancellationToken
Returns
Type Description
Task<ErpSyncFieldValue[]>

The Crm Fields

GetFieldValuesFromErpAsync(int, ErpActorType, string, CancellationToken)

Get Erp Field values

Online Restricted: The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.
Declaration
Task<ErpSyncFieldValue[]> GetFieldValuesFromErpAsync(int erpConnectionId, ErpActorType actorTypeErp, string erpKey, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int erpConnectionId

Erp connection id

ErpActorType actorTypeErp

ERP Actor type

string erpKey

Primary key for the erp actor

CancellationToken cancellationToken
Returns
Type Description
Task<ErpSyncFieldValue[]>

The Erp Fields

GetFieldsForNewErpActorAsync(int, ErpActorType, CancellationToken)

Get the fields that must be filled out when creating a new ERP actor

Online Restricted: The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.
Declaration
Task<FieldMetadata[]> GetFieldsForNewErpActorAsync(int erpConnectionId, ErpActorType erpActorType, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int erpConnectionId

The id of the connection

ErpActorType erpActorType

The type of the ERP actor to create

CancellationToken cancellationToken
Returns
Type Description
Task<FieldMetadata[]>

The fields that are required for the new ERP actor

MoveErpFieldItemAsync(int, int, int, ErpActorType, CancellationToken)

Moves the rank of the erp field up or down

Online Restricted: The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.
Declaration
Task MoveErpFieldItemAsync(int erpFieldId, int direction, int erpConnectionId, ErpActorType erpActorType, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int erpFieldId

The id of the erp field to move

int direction

Positive value to increase rank, negative to decrease.

int erpConnectionId

The id of the connection

ErpActorType erpActorType

The actor type for which we want to rank fields

CancellationToken cancellationToken
Returns
Type Description
Task

SaveActorTypeMappingAsync(ErpSyncActorTypeMapping, CancellationToken)

Save mappings for a connection/actor

Online Restricted: The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.
Declaration
Task<ErpSyncActorTypeMapping> SaveActorTypeMappingAsync(ErpSyncActorTypeMapping mapping, CancellationToken cancellationToken = default)
Parameters
Type Name Description
ErpSyncActorTypeMapping mapping

The mapping to be saved; new mapping rows will be created in the database if needed

CancellationToken cancellationToken
Returns
Type Description
Task<ErpSyncActorTypeMapping>

The current mapping from the database

SaveConnectionAsync(ErpConnection, CancellationToken)

Saves a connection to the database.

Online Restricted: The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.
Declaration
Task<ErpConnection> SaveConnectionAsync(ErpConnection connection, CancellationToken cancellationToken = default)
Parameters
Type Name Description
ErpConnection connection

The connection to save.

CancellationToken cancellationToken
Returns
Type Description
Task<ErpConnection>

The resulting connection.

SaveConnectionListMappingsAsync(ErpConnectionListMappingContainer, CancellationToken)

Saves a connection to the database.

Online Restricted: The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.
Declaration
Task<ErpConnectionListMappingContainer> SaveConnectionListMappingsAsync(ErpConnectionListMappingContainer listMapping, CancellationToken cancellationToken = default)
Parameters
Type Name Description
ErpConnectionListMappingContainer listMapping

The list item mappings to save.

CancellationToken cancellationToken
Returns
Type Description
Task<ErpConnectionListMappingContainer>

The saved list mappings.

SaveDefaultValueInfoAsync(ErpSyncDefaultValue, CancellationToken)

Save information about a default value for an ERP field

Online Restricted: The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.
Declaration
Task<ErpSyncDefaultValue> SaveDefaultValueInfoAsync(ErpSyncDefaultValue erpSyncDefaultValue, CancellationToken cancellationToken = default)
Parameters
Type Name Description
ErpSyncDefaultValue erpSyncDefaultValue

The id of the ERPfield to save

CancellationToken cancellationToken
Returns
Type Description
Task<ErpSyncDefaultValue>

The newly saved ErpSyncDefaultValue

SaveErpConnectionSyncPrioritiesAsync(int[], CancellationToken)

Takes an array of the ErpConnection ids and saves these as ordered sync priorities

Online Restricted: The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.
Declaration
Task<bool> SaveErpConnectionSyncPrioritiesAsync(int[] erpConnectionIds, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int[] erpConnectionIds

The id put in array in the same order as the priorities

CancellationToken cancellationToken
Returns
Type Description
Task<bool>

Returns true if new sync priorities is saved

SaveErpSyncConnectorEntityAsync(ErpSyncConnectorEntity, CancellationToken)

Updates the existing ErpSyncConnectorEntity or creates a new ErpSyncConnectorEntity if the id parameter is 0.

Online Restricted: The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.
Declaration
Task<ErpSyncConnectorEntity> SaveErpSyncConnectorEntityAsync(ErpSyncConnectorEntity erpSyncConnectorEntity, CancellationToken cancellationToken = default)
Parameters
Type Name Description
ErpSyncConnectorEntity erpSyncConnectorEntity

The ErpSyncConnectorEntity that is saved

CancellationToken cancellationToken
Returns
Type Description
Task<ErpSyncConnectorEntity>

New or updated ErpSyncConnectorEntity

SupportsAdvancedSearchAsync(int, ErpActorType, CancellationToken)

Indicates if the connection supports advanced search for the given erp actor

Online Restricted: The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.
Declaration
Task<bool> SupportsAdvancedSearchAsync(int erpConnectionId, ErpActorType erpActorType, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int erpConnectionId

Ths id of the connection

ErpActorType erpActorType

The erp actor type to check for

CancellationToken cancellationToken
Returns
Type Description
Task<bool>

True if advanced search is supported

SyncAllAsync(CancellationToken)

Sync all active connections

Online Restricted: The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.
Declaration
Task<PluginResponse> SyncAllAsync(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
Task<PluginResponse>

The response

TestConnectionByConfigAsync(int, StringDictionary, CancellationToken)

Tests to see if the given connection has a valid connection to its connector

Online Restricted: The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.
Declaration
Task<bool> TestConnectionByConfigAsync(int erpConnectionId, StringDictionary configFields, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int erpConnectionId

The id of the connector we try to connect to

StringDictionary configFields

The config fields used to test connection

CancellationToken cancellationToken
Returns
Type Description
Task<bool>

Returns true if success

TestConnectionByIdAsync(int, CancellationToken)

Tests to see if we can establish a connection with the given config fields

Online Restricted: The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.
Declaration
Task<bool> TestConnectionByIdAsync(int erpConnectionId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int erpConnectionId

The id of the connection

CancellationToken cancellationToken
Returns
Type Description
Task<bool>

Returns true if success

TestConnectorUrlAsync(string, CancellationToken)

Test if connector urls anwers

Online Restricted: The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.
Declaration
Task<ErpSyncResponseCode> TestConnectorUrlAsync(string url, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string url

The url to test connection on

CancellationToken cancellationToken
Returns
Type Description
Task<ErpSyncResponseCode>

Enum response says ok or what is wrong

ToggleErpConnectionActiveAsync(int, CancellationToken)

Toggles the Active state of the connection

Online Restricted: The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.
Declaration
Task<string[]> ToggleErpConnectionActiveAsync(int erpConnectionId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int erpConnectionId

Primary key of the erp connection

CancellationToken cancellationToken
Returns
Type Description
Task<string[]>

Contains the reason for why the toggle failed. Empty if operation was successful

TryConnectActorAsync(int, int, CrmActorType, string, ErpActorType, ErpSyncFieldValue[], CancellationToken)

Create a link between Erp and Crm and set default values

Online Restricted: The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.
Declaration
Task<bool> TryConnectActorAsync(int erpConnectionId, int crmRecordId, CrmActorType crmActorType, string erpKey, ErpActorType erpActorType, ErpSyncFieldValue[] fieldValues, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int erpConnectionId

ErpConnectionId

int crmRecordId

CrmRecordId

CrmActorType crmActorType

The Crm Actor type

string erpKey
ErpActorType erpActorType

The Erp Actor type

ErpSyncFieldValue[] fieldValues

The Crm Fields

CancellationToken cancellationToken
Returns
Type Description
Task<bool>

UpdateConnectionFieldsAsync(int, CancellationToken)

Gets all supported actor types, and all fields for each actor type, and save this state to the CRM database

Online Restricted: The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.
Declaration
Task<bool> UpdateConnectionFieldsAsync(int erpConnectionId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int erpConnectionId

The ERP connection ID

CancellationToken cancellationToken
Returns
Type Description
Task<bool>

Success or fail

ValidateArchiveColumnConfigAsync(string, int, CancellationToken)

Clear field info from table SUPERLISTCOLUMNSIZE if field mapping changed on given connection

Online Restricted: The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.
Declaration
Task ValidateArchiveColumnConfigAsync(string listOwner, int erpConnectionId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string listOwner

GUI name used in archive control config

int erpConnectionId

The ERP connection ID

CancellationToken cancellationToken
Returns
Type Description
Task

Validated ArchiveColumnConfig

© SuperOffice. All rights reserved.
SuperOffice |  Community |  Release Notes |  Privacy |  Site feedback |  Search Docs |  About Docs |  Contribute |  Back to top