Class ErpSyncAgent
Proxy class for the ErpSync Agent Used when communicating remote using WebServices. Avoid using directly. Use the AgentFactory to create the proxy instead.
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.Inherited Members
Namespace: SuperOffice.CRM.Services
Assembly: SuperOffice.Services.Implementation.dll
Syntax
public class ErpSyncAgent : IErpSyncAgent, IAgent
Constructors
ErpSyncAgent(IErpConnectionImplementation, IErpConnectionDataImplementation, IErpConnectionListMappingContainerImplementation, IErpSyncFieldValueImplementation, IErpSyncActorTypeMappingImplementation, IErpSyncConnectionSummaryImplementation, IErpSyncConnectorEntityImplementation, IErpSyncDefaultValueImplementation, IErpSyncEngineImplementation, IErpSyncEngineStatusImplementation, ISoRequestItemsAccessor)
Proxy class for the ErpSync Agent Used when communicating remote using WebServices. Avoid using directly. Use the AgentFactory to create the proxy instead.
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.Declaration
public ErpSyncAgent(IErpConnectionImplementation erpConnectionImplementation, IErpConnectionDataImplementation erpConnectionDataImplementation, IErpConnectionListMappingContainerImplementation erpConnectionListMappingContainerImplementation, IErpSyncFieldValueImplementation erpSyncFieldValueImplementation, IErpSyncActorTypeMappingImplementation erpSyncActorTypeMappingImplementation, IErpSyncConnectionSummaryImplementation erpSyncConnectionSummaryImplementation, IErpSyncConnectorEntityImplementation erpSyncConnectorEntityImplementation, IErpSyncDefaultValueImplementation erpSyncDefaultValueImplementation, IErpSyncEngineImplementation erpSyncEngineImplementation, IErpSyncEngineStatusImplementation erpSyncEngineStatusImplementation, ISoRequestItemsAccessor accessor)
Parameters
| Type | Name | Description |
|---|---|---|
| IErpConnectionImplementation | erpConnectionImplementation | |
| IErpConnectionDataImplementation | erpConnectionDataImplementation | |
| IErpConnectionListMappingContainerImplementation | erpConnectionListMappingContainerImplementation | |
| IErpSyncFieldValueImplementation | erpSyncFieldValueImplementation | |
| IErpSyncActorTypeMappingImplementation | erpSyncActorTypeMappingImplementation | |
| IErpSyncConnectionSummaryImplementation | erpSyncConnectionSummaryImplementation | |
| IErpSyncConnectorEntityImplementation | erpSyncConnectorEntityImplementation | |
| IErpSyncDefaultValueImplementation | erpSyncDefaultValueImplementation | |
| IErpSyncEngineImplementation | erpSyncEngineImplementation | |
| IErpSyncEngineStatusImplementation | erpSyncEngineStatusImplementation | |
| ISoRequestItemsAccessor | accessor |
ErpSyncAgent(IErpConnectionImplementation, IErpConnectionDataImplementation, IErpConnectionListMappingContainerImplementation, IErpSyncFieldValueImplementation, IErpSyncActorTypeMappingImplementation, IErpSyncConnectionSummaryImplementation, IErpSyncConnectorEntityImplementation, IErpSyncDefaultValueImplementation, IErpSyncEngineImplementation, IErpSyncEngineStatusImplementation, ISoRequestItemsAccessor, IDebugUser, IServiceCallsRepository, IScriptingConfiguration, IOnlineConfiguration)
Proxy class for the ErpSync Agent Used when communicating remote using WebServices. Avoid using directly. Use the AgentFactory to create the proxy instead.
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.Declaration
public ErpSyncAgent(IErpConnectionImplementation erpConnectionImplementation, IErpConnectionDataImplementation erpConnectionDataImplementation, IErpConnectionListMappingContainerImplementation erpConnectionListMappingContainerImplementation, IErpSyncFieldValueImplementation erpSyncFieldValueImplementation, IErpSyncActorTypeMappingImplementation erpSyncActorTypeMappingImplementation, IErpSyncConnectionSummaryImplementation erpSyncConnectionSummaryImplementation, IErpSyncConnectorEntityImplementation erpSyncConnectorEntityImplementation, IErpSyncDefaultValueImplementation erpSyncDefaultValueImplementation, IErpSyncEngineImplementation erpSyncEngineImplementation, IErpSyncEngineStatusImplementation erpSyncEngineStatusImplementation, ISoRequestItemsAccessor accessor, IDebugUser debugUser, IServiceCallsRepository serviceCallsRepository, ConfigFile.IScriptingConfiguration scriptingConfiguration, ConfigFile.IOnlineConfiguration onlineConfiguration)
Parameters
| Type | Name | Description |
|---|---|---|
| IErpConnectionImplementation | erpConnectionImplementation | |
| IErpConnectionDataImplementation | erpConnectionDataImplementation | |
| IErpConnectionListMappingContainerImplementation | erpConnectionListMappingContainerImplementation | |
| IErpSyncFieldValueImplementation | erpSyncFieldValueImplementation | |
| IErpSyncActorTypeMappingImplementation | erpSyncActorTypeMappingImplementation | |
| IErpSyncConnectionSummaryImplementation | erpSyncConnectionSummaryImplementation | |
| IErpSyncConnectorEntityImplementation | erpSyncConnectorEntityImplementation | |
| IErpSyncDefaultValueImplementation | erpSyncDefaultValueImplementation | |
| IErpSyncEngineImplementation | erpSyncEngineImplementation | |
| IErpSyncEngineStatusImplementation | erpSyncEngineStatusImplementation | |
| ISoRequestItemsAccessor | accessor | |
| IDebugUser | debugUser | |
| IServiceCallsRepository | serviceCallsRepository | |
| IScriptingConfiguration | scriptingConfiguration | |
| IOnlineConfiguration | onlineConfiguration |
Methods
BreakActorLinkAsync(int, int, CrmActorType, CancellationToken)
Remove the link between a CRM entity and an ERP entity
Declaration
public 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 | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<bool> | True if success |
CanDeleteErpSyncConnectorEntityAsync(int, CancellationToken)
Can we delete the connector?
Declaration
public 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 | This operation cannot be cancelled; the cancellationToken parameter is ignored |
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
Declaration
public Task ChangeEngineIntervalAsync(TimeSpan interval, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| TimeSpan | interval | The run interval for the engine |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task |
ChangeEngineStatusAsync(bool, CancellationToken)
Change the current running/stopped status of the Sync engine
Declaration
public 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 | This operation cannot be cancelled; the cancellationToken parameter is ignored |
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
Declaration
public 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 | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task |
CreateActorLinkAsync(int, int, CrmActorType, string, ErpActorType, CancellationToken)
Link a crm entity to an erp entity
Declaration
public 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 | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<bool> | True if success |
CreateDefaultErpSyncConnectorEntityAsync(CancellationToken)
Loading default values into a new ErpSyncConnectorEntity.
Declaration
public Task<ErpSyncConnectorEntity> CreateDefaultErpSyncConnectorEntityAsync(CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<ErpSyncConnectorEntity> | New ErpSyncConnectorEntity with default values |
CreateErpActorFromCrmAsync(int, int, ErpActorType, CrmActorType, StringDictionary, CancellationToken)
Create ErpActor from crm entity
Declaration
public 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 | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<bool> | Created ERP actor with success |
DeleteConnectionAsync(int, CancellationToken)
Deletes a connection from the database.
Declaration
public Task DeleteConnectionAsync(int erpConnectionId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | erpConnectionId | Primary key of the connection |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task | A void return |
DeleteErpSyncConnectorEntityAsync(int, CancellationToken)
Deletes the ErpSyncConnectorEntity
Declaration
public Task DeleteErpSyncConnectorEntityAsync(int erpSyncConnectorEntityId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | erpSyncConnectorEntityId | The identity of the ErpSyncConnectorEntity |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
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
Declaration
public 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 | This operation cannot be cancelled; the cancellationToken parameter is ignored |
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
Declaration
public 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 | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task |
ForceResyncExternalAsync(int, ErpActorType, string[], CancellationToken)
Force resync from CRM or given Erp connection to all other connections, using external keys
Declaration
public 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 | This operation cannot be cancelled; the cancellationToken parameter is ignored |
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.
Declaration
public 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 | This operation cannot be cancelled; the cancellationToken parameter is ignored |
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.
Declaration
public 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 | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<PluginResponse> | The response |
ForceSyncAllAsync(CancellationToken)
Sync all active connections even when automatic sync is off
Declaration
public Task<PluginResponse> ForceSyncAllAsync(CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<PluginResponse> | The response |
GetActorTypeMappingAsync(int, ErpActorType, CancellationToken)
Get the current mappings for one connection/actor; connection+actor type = unique key
Declaration
public 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 | This operation cannot be cancelled; the cancellationToken parameter is ignored |
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.
Declaration
public Task<ErpConnection[]> GetAllConnectionsAsync(bool includeDeleted, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | includeDeleted | Include deleted connections in the result? |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<ErpConnection[]> | The connection id, name, description |
GetAllConnectorsAsync(CancellationToken)
Returns all ERP Sync connectors. Uses the ErpConnector archive.
Declaration
public Task<ListItem[]> GetAllConnectorsAsync(CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<ListItem[]> | The connector id, name, url |
GetConfigurationFieldsAsync(int, CancellationToken)
Returns all fields needed to connect to the given connector
Declaration
public Task<FieldMetadata[]> GetConfigurationFieldsAsync(int erpConnectorId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | erpConnectorId | The id of the erp connector |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<FieldMetadata[]> | The fields |
GetConnectionAsync(int, CancellationToken)
Returns the specified connection.
Declaration
public Task<ErpConnection> GetConnectionAsync(int erpConnectionId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | erpConnectionId | Primary key of the connection |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<ErpConnection> | The connection |
GetConnectionListMappingsAsync(int, CancellationToken)
Returns the listmappings for the specified connection.
Declaration
public Task<ErpConnectionListMappingContainer> GetConnectionListMappingsAsync(int erpConnectionId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | erpConnectionId | Primary key of the connection |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<ErpConnectionListMappingContainer> | The listmappings |
GetConnectionsAndDisplayFieldsAsync(CrmActorType, int, CancellationToken)
Get all connection statuses and fields for a given entity
Declaration
public 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 | This operation cannot be cancelled; the cancellationToken parameter is ignored |
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
Declaration
public 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 | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<CrmActorType> | The CrmActorType |
GetDefaultValueInfoAsync(int, CancellationToken)
Get information about default value for an ERP field
Declaration
public Task<ErpSyncDefaultValue> GetDefaultValueInfoAsync(int erpFieldId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | erpFieldId | The id of the ERP field |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<ErpSyncDefaultValue> | Object with information about default values |
GetEngineStatusAsync(CancellationToken)
Get the current status of the Sync engine
Declaration
public Task<ErpSyncEngineStatus> GetEngineStatusAsync(CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<ErpSyncEngineStatus> | The current status of the engine |
GetErpConnectionConfigFieldsAsync(int, CancellationToken)
Returns the config fields for the connection.
Declaration
public Task<StringDictionary> GetErpConnectionConfigFieldsAsync(int erpConnectionId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | erpConnectionId | Primary key of the erp connection |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<StringDictionary> | Config Fields |
GetErpFieldValuesAsync(int, CrmActorType, int, string[], CancellationToken)
Get the values for the specified fields from the ERP connection
Declaration
public 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 | This operation cannot be cancelled; the cancellationToken parameter is ignored |
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
Declaration
public 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 | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<ErpSyncConnectionSummary> | Summary of connection information, and one summary element per configured actor type |
GetErpSyncConnectorEntityAsync(int, CancellationToken)
Gets a ErpSyncConnectorEntity object.
Declaration
public Task<ErpSyncConnectorEntity> GetErpSyncConnectorEntityAsync(int erpSyncConnectorEntityId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | erpSyncConnectorEntityId | The identifier of the ErpSyncConnectorEntity object |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<ErpSyncConnectorEntity> | A single ErpSyncConnectorEntity |
GetFieldValuesFromCrmAsync(int, CrmActorType, CancellationToken)
Get Crm Field values
Declaration
public 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 | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<ErpSyncFieldValue[]> | The Crm Fields |
GetFieldValuesFromErpAsync(int, ErpActorType, string, CancellationToken)
Get Erp Field values
Declaration
public 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 | This operation cannot be cancelled; the cancellationToken parameter is ignored |
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
Declaration
public 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 | This operation cannot be cancelled; the cancellationToken parameter is ignored |
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
Declaration
public 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 | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task |
SaveActorTypeMappingAsync(ErpSyncActorTypeMapping, CancellationToken)
Save mappings for a connection/actor
Declaration
public 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 | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<ErpSyncActorTypeMapping> | The current mapping from the database |
SaveConnectionAsync(ErpConnection, CancellationToken)
Saves a connection to the database.
Declaration
public Task<ErpConnection> SaveConnectionAsync(ErpConnection connection, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| ErpConnection | connection | The connection to save. |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<ErpConnection> | The resulting connection. |
SaveConnectionListMappingsAsync(ErpConnectionListMappingContainer, CancellationToken)
Saves a connection to the database.
Declaration
public Task<ErpConnectionListMappingContainer> SaveConnectionListMappingsAsync(ErpConnectionListMappingContainer listMapping, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| ErpConnectionListMappingContainer | listMapping | The list item mappings to save. |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<ErpConnectionListMappingContainer> | The saved list mappings. |
SaveDefaultValueInfoAsync(ErpSyncDefaultValue, CancellationToken)
Save information about a default value for an ERP field
Declaration
public Task<ErpSyncDefaultValue> SaveDefaultValueInfoAsync(ErpSyncDefaultValue erpSyncDefaultValue, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| ErpSyncDefaultValue | erpSyncDefaultValue | The id of the ERPfield to save |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
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
Declaration
public 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 | This operation cannot be cancelled; the cancellationToken parameter is ignored |
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.
Declaration
public Task<ErpSyncConnectorEntity> SaveErpSyncConnectorEntityAsync(ErpSyncConnectorEntity erpSyncConnectorEntity, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| ErpSyncConnectorEntity | erpSyncConnectorEntity | The ErpSyncConnectorEntity that is saved |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
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
Declaration
public 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 | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<bool> | True if advanced search is supported |
SyncAllAsync(CancellationToken)
Sync all active connections
Declaration
public Task<PluginResponse> SyncAllAsync(CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
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
Declaration
public 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 | This operation cannot be cancelled; the cancellationToken parameter is ignored |
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
Declaration
public Task<bool> TestConnectionByIdAsync(int erpConnectionId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | erpConnectionId | The id of the connection |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<bool> | Returns true if success |
TestConnectorUrlAsync(string, CancellationToken)
Test if connector urls anwers
Declaration
public Task<ErpSyncResponseCode> TestConnectorUrlAsync(string url, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | url | The url to test connection on |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<ErpSyncResponseCode> | Enum response says ok or what is wrong |
ToggleErpConnectionActiveAsync(int, CancellationToken)
Toggles the Active state of the connection
Declaration
public Task<string[]> ToggleErpConnectionActiveAsync(int erpConnectionId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | erpConnectionId | Primary key of the erp connection |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
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
Declaration
public 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 | This operation cannot be cancelled; the cancellationToken parameter is ignored |
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
Declaration
public Task<bool> UpdateConnectionFieldsAsync(int erpConnectionId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | erpConnectionId | The ERP connection ID |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
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
Declaration
public 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 | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task | Validated ArchiveColumnConfig |