> ## Documentation Index
> Fetch the complete documentation index at: https://docs.superoffice.com/llms.txt
> Use this file to discover all available pages before exploring further.

# SuperOffice.WebApi.Agents.IErpSyncAgent

# \<a id="SuperOffice\_WebApi\_Agents\_IErpSyncAgent">\</a> Interface IErpSyncAgent

Namespace: [SuperOffice.WebApi.Agents](SuperOffice.WebApi.Agents.md)\
Assembly: SuperOffice.WebApi.dll

Services for the ERP Integration Services feature
\<p>\</p>
\<b>Online Restricted:\</b> This agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.

```csharp theme={null}
public interface IErpSyncAgent : IAgentBase, IDisposable
```

#### Implements

[IAgentBase](SuperOffice.WebApi.Agents.IAgentBase.md),
[IDisposable](https://learn.microsoft.com/dotnet/api/system.idisposable)

## Methods

### \<a id="SuperOffice\_WebApi\_Agents\_IErpSyncAgent\_BreakActorLinkAsync\_System\_Int32\_System\_Int32\_SuperOffice\_WebApi\_Data\_CrmActorType\_SuperOffice\_WebApi\_RequestOptions\_">\</a> BreakActorLinkAsync(int, int, CrmActorType, RequestOptions)

Remove the link between a CRM entity and an ERP entity
\<p>\</p>
\<b>Online Restricted:\</b> The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.

```csharp theme={null}
Task<bool> BreakActorLinkAsync(int erpConnectionId, int crmRecordId, CrmActorType crmActorType, RequestOptions requestOptions = null)
```

#### Parameters

`erpConnectionId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The ERP connection ID

`crmRecordId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The ID of the CRM entity to connect to

`crmActorType` [CrmActorType](SuperOffice.WebApi.Data.CrmActorType.md)

Identifies the CRM actor type corresponding to this CRM entity

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[bool](https://learn.microsoft.com/dotnet/api/system.boolean)\&gt;

True if success

### \<a id="SuperOffice\_WebApi\_Agents\_IErpSyncAgent\_CanDeleteErpSyncConnectorEntityAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> CanDeleteErpSyncConnectorEntityAsync(int, RequestOptions)

Can we delete the connector?
\<p>\</p>
\<b>Online Restricted:\</b> The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.

```csharp theme={null}
Task<ErpSyncResponseCode> CanDeleteErpSyncConnectorEntityAsync(int erpSyncConnectorId, RequestOptions requestOptions = null)
```

#### Parameters

`erpSyncConnectorId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

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

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[ErpSyncResponseCode](SuperOffice.WebApi.Data.ErpSyncResponseCode.md)\&gt;

Enum response says ok or what is wrong

### \<a id="SuperOffice\_WebApi\_Agents\_IErpSyncAgent\_ChangeEngineIntervalAsync\_System\_TimeSpan\_SuperOffice\_WebApi\_RequestOptions\_">\</a> ChangeEngineIntervalAsync(TimeSpan, RequestOptions)

Change the interval for each run of the Sync Engine
\<p>\</p>
\<b>Online Restricted:\</b> The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.

```csharp theme={null}
Task ChangeEngineIntervalAsync(TimeSpan interval, RequestOptions requestOptions = null)
```

#### Parameters

`interval` [TimeSpan](https://learn.microsoft.com/dotnet/api/system.timespan)

The run interval for the engine

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### \<a id="SuperOffice\_WebApi\_Agents\_IErpSyncAgent\_ChangeEngineStatusAsync\_System\_Boolean\_SuperOffice\_WebApi\_RequestOptions\_">\</a> ChangeEngineStatusAsync(bool, RequestOptions)

Change the current running/stopped status of the Sync engine
\<p>\</p>
\<b>Online Restricted:\</b> The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.

```csharp theme={null}
Task<ErpSyncEngineStatus> ChangeEngineStatusAsync(bool run, RequestOptions requestOptions = null)
```

#### Parameters

`run` [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

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

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[ErpSyncEngineStatus](SuperOffice.WebApi.Data.ErpSyncEngineStatus.md)\&gt;

The current status of the engine

### \<a id="SuperOffice\_WebApi\_Agents\_IErpSyncAgent\_ConnectActorAsync\_System\_Int32\_System\_Int32\_SuperOffice\_WebApi\_Data\_CrmActorType\_System\_String\_SuperOffice\_WebApi\_Data\_ErpActorType\_SuperOffice\_WebApi\_Data\_ErpSyncFieldValue\_\_\_SuperOffice\_WebApi\_RequestOptions\_">\</a> ConnectActorAsync(int, int, CrmActorType, string, ErpActorType, ErpSyncFieldValue\[], RequestOptions)

Create a link between Erp and Crm and set default values
\<p>\</p>
\<b>Online Restricted:\</b> The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.

```csharp theme={null}
Task ConnectActorAsync(int erpConnectionId, int crmRecordId, CrmActorType crmActorType, string erpKey, ErpActorType erpActorType, ErpSyncFieldValue[] fieldValues, RequestOptions requestOptions = null)
```

#### Parameters

`erpConnectionId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

ErpConnectionId

`crmRecordId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

CrmRecordId

`crmActorType` [CrmActorType](SuperOffice.WebApi.Data.CrmActorType.md)

The Crm Actor type

`erpKey` [string](https://learn.microsoft.com/dotnet/api/system.string)

`erpActorType` [ErpActorType](SuperOffice.WebApi.Data.ErpActorType.md)

The Erp Actor type

`fieldValues` [ErpSyncFieldValue](SuperOffice.WebApi.Data.ErpSyncFieldValue.md)\[]

The Crm Fields

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### \<a id="SuperOffice\_WebApi\_Agents\_IErpSyncAgent\_CreateActorLinkAsync\_System\_Int32\_System\_Int32\_SuperOffice\_WebApi\_Data\_CrmActorType\_System\_String\_SuperOffice\_WebApi\_Data\_ErpActorType\_SuperOffice\_WebApi\_RequestOptions\_">\</a> CreateActorLinkAsync(int, int, CrmActorType, string, ErpActorType, RequestOptions)

Link a crm entity to an erp entity
\<p>\</p>
\<b>Online Restricted:\</b> The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.

```csharp theme={null}
Task<bool> CreateActorLinkAsync(int erpConnectionId, int crmRecordId, CrmActorType crmActorType, string erpKey, ErpActorType erpActorType, RequestOptions requestOptions = null)
```

#### Parameters

`erpConnectionId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The ERP connection ID

`crmRecordId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The ID of the CRM entity to connect to

`crmActorType` [CrmActorType](SuperOffice.WebApi.Data.CrmActorType.md)

Identifies the CRM actor type corresponding to this CRM entity

`erpKey` [string](https://learn.microsoft.com/dotnet/api/system.string)

The ERP entity identifier

`erpActorType` [ErpActorType](SuperOffice.WebApi.Data.ErpActorType.md)

The ERP actor type

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[bool](https://learn.microsoft.com/dotnet/api/system.boolean)\&gt;

True if success

### \<a id="SuperOffice\_WebApi\_Agents\_IErpSyncAgent\_CreateDefaultErpSyncConnectorEntityAsync\_SuperOffice\_WebApi\_RequestOptions\_">\</a> CreateDefaultErpSyncConnectorEntityAsync(RequestOptions)

Set default values into a new ErpSyncConnectorEntity.
NetServer calculates default values on the entity, which is required when creating/storing a new instance

```csharp theme={null}
Task<ErpSyncConnectorEntity> CreateDefaultErpSyncConnectorEntityAsync(RequestOptions requestOptions = null)
```

#### Parameters

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[ErpSyncConnectorEntity](SuperOffice.WebApi.Data.ErpSyncConnectorEntity.md)\&gt;

A blank ErpSyncConnectorEntity

### \<a id="SuperOffice\_WebApi\_Agents\_IErpSyncAgent\_CreateErpActorFromCrmAsync\_System\_Int32\_System\_Int32\_SuperOffice\_WebApi\_Data\_ErpActorType\_SuperOffice\_WebApi\_Data\_CrmActorType\_SuperOffice\_WebApi\_Data\_StringDictionary\_SuperOffice\_WebApi\_RequestOptions\_">\</a> CreateErpActorFromCrmAsync(int, int, ErpActorType, CrmActorType, StringDictionary, RequestOptions)

Create ErpActor from crm entity
\<p>\</p>
\<b>Online Restricted:\</b> The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.

```csharp theme={null}
Task<bool> CreateErpActorFromCrmAsync(int connectionId, int crmEntityId, ErpActorType erpActorType, CrmActorType crmActorType, StringDictionary erpFieldKeyValues, RequestOptions requestOptions = null)
```

#### Parameters

`connectionId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The connection ID

`crmEntityId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

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

`erpActorType` [ErpActorType](SuperOffice.WebApi.Data.ErpActorType.md)

The ERP actor type

`crmActorType` [CrmActorType](SuperOffice.WebApi.Data.CrmActorType.md)

The CRM actor type

`erpFieldKeyValues` [StringDictionary](SuperOffice.WebApi.Data.StringDictionary.md)

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

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[bool](https://learn.microsoft.com/dotnet/api/system.boolean)\&gt;

Created ERP actor with success

### \<a id="SuperOffice\_WebApi\_Agents\_IErpSyncAgent\_DeleteConnectionAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> DeleteConnectionAsync(int, RequestOptions)

Deletes a connection from the database.
\<p>\</p>
\<b>Online Restricted:\</b> The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.

```csharp theme={null}
Task DeleteConnectionAsync(int erpConnectionId, RequestOptions requestOptions = null)
```

#### Parameters

`erpConnectionId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

Primary key of the connection

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

A void return

### \<a id="SuperOffice\_WebApi\_Agents\_IErpSyncAgent\_DeleteErpSyncConnectorEntityAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> DeleteErpSyncConnectorEntityAsync(int, RequestOptions)

Deletes the ErpSyncConnectorEntity
\<p>\</p>
\<b>Online Restricted:\</b> The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.

```csharp theme={null}
Task DeleteErpSyncConnectorEntityAsync(int erpSyncConnectorEntityId, RequestOptions requestOptions = null)
```

#### Parameters

`erpSyncConnectorEntityId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The identity of the ErpSyncConnectorEntity

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### \<a id="SuperOffice\_WebApi\_Agents\_IErpSyncAgent\_ForceResyncAsync\_System\_Int32\_System\_Int32\_\_\_SuperOffice\_WebApi\_RequestOptions\_">\</a> ForceResyncAsync(int, int\[], RequestOptions)

Force resync from CRM or given Erp connection to all other connections
\<p>\</p>
\<b>Online Restricted:\</b> The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.

```csharp theme={null}
Task<PluginResponse> ForceResyncAsync(int erpConnectionId, int[] internalKeyIds, RequestOptions requestOptions = null)
```

#### Parameters

`erpConnectionId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

If positive, resync from the given erp connection

`internalKeyIds` [int](https://learn.microsoft.com/dotnet/api/system.int32)\[]

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

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[PluginResponse](SuperOffice.WebApi.Data.PluginResponse.md)\&gt;

The response

### \<a id="SuperOffice\_WebApi\_Agents\_IErpSyncAgent\_ForceResyncBatchTaskAsync\_System\_Int32\_System\_Int32\_\_\_SuperOffice\_WebApi\_RequestOptions\_">\</a> ForceResyncBatchTaskAsync(int, int\[], RequestOptions)

Start batch task to force resync from CRM or given Erp connection to all other connections
\<p>\</p>
\<b>Online Restricted:\</b> The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.

```csharp theme={null}
Task ForceResyncBatchTaskAsync(int erpConnectionId, int[] internalKeyIds, RequestOptions requestOptions = null)
```

#### Parameters

`erpConnectionId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

If positive, resync from the given erp connection

`internalKeyIds` [int](https://learn.microsoft.com/dotnet/api/system.int32)\[]

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

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### \<a id="SuperOffice\_WebApi\_Agents\_IErpSyncAgent\_ForceResyncExternalAsync\_System\_Int32\_SuperOffice\_WebApi\_Data\_ErpActorType\_System\_String\_\_\_SuperOffice\_WebApi\_RequestOptions\_">\</a> ForceResyncExternalAsync(int, ErpActorType, string\[], RequestOptions)

Force resync from CRM or given Erp connection to all other connections, using external keys
\<p>\</p>
\<b>Online Restricted:\</b> The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.

```csharp theme={null}
Task<PluginResponse> ForceResyncExternalAsync(int erpConnectionId, ErpActorType erpActorType, string[] externalKeys, RequestOptions requestOptions = null)
```

#### Parameters

`erpConnectionId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

Resync from the given erp connection

`erpActorType` [ErpActorType](SuperOffice.WebApi.Data.ErpActorType.md)

Which actor type the external keys are associated with

`externalKeys` [string](https://learn.microsoft.com/dotnet/api/system.string)\[]

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

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[PluginResponse](SuperOffice.WebApi.Data.PluginResponse.md)\&gt;

The response

### \<a id="SuperOffice\_WebApi\_Agents\_IErpSyncAgent\_ForceResyncExternalNoBlankValuesAsync\_System\_Int32\_SuperOffice\_WebApi\_Data\_ErpActorType\_System\_String\_\_\_SuperOffice\_WebApi\_RequestOptions\_">\</a> ForceResyncExternalNoBlankValuesAsync(int, ErpActorType, string\[], RequestOptions)

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.
\<p>\</p>
\<b>Online Restricted:\</b> The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.

```csharp theme={null}
Task<PluginResponse> ForceResyncExternalNoBlankValuesAsync(int erpConnectionId, ErpActorType erpActorType, string[] externalKeys, RequestOptions requestOptions = null)
```

#### Parameters

`erpConnectionId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

Resync from the given erp connection

`erpActorType` [ErpActorType](SuperOffice.WebApi.Data.ErpActorType.md)

Which actor type the external keys are associated with

`externalKeys` [string](https://learn.microsoft.com/dotnet/api/system.string)\[]

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

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[PluginResponse](SuperOffice.WebApi.Data.PluginResponse.md)\&gt;

The response

### \<a id="SuperOffice\_WebApi\_Agents\_IErpSyncAgent\_ForceResyncNoBlankValuesAsync\_System\_Int32\_System\_Int32\_\_\_SuperOffice\_WebApi\_RequestOptions\_">\</a> ForceResyncNoBlankValuesAsync(int, int\[], RequestOptions)

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.
\<p>\</p>
\<b>Online Restricted:\</b> The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.

```csharp theme={null}
Task<PluginResponse> ForceResyncNoBlankValuesAsync(int erpConnectionId, int[] internalKeyIds, RequestOptions requestOptions = null)
```

#### Parameters

`erpConnectionId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

If positive, resync from the given erp connection

`internalKeyIds` [int](https://learn.microsoft.com/dotnet/api/system.int32)\[]

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

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[PluginResponse](SuperOffice.WebApi.Data.PluginResponse.md)\&gt;

The response

### \<a id="SuperOffice\_WebApi\_Agents\_IErpSyncAgent\_ForceSyncAllAsync\_SuperOffice\_WebApi\_RequestOptions\_">\</a> ForceSyncAllAsync(RequestOptions)

Sync all active connections even when automatic sync is off
\<p>\</p>
\<b>Online Restricted:\</b> The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.

```csharp theme={null}
Task<PluginResponse> ForceSyncAllAsync(RequestOptions requestOptions = null)
```

#### Parameters

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[PluginResponse](SuperOffice.WebApi.Data.PluginResponse.md)\&gt;

The response

### \<a id="SuperOffice\_WebApi\_Agents\_IErpSyncAgent\_GetActorTypeMappingAsync\_System\_Int32\_SuperOffice\_WebApi\_Data\_ErpActorType\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetActorTypeMappingAsync(int, ErpActorType, RequestOptions)

Get the current mappings for one connection/actor; connection+actor type = unique key
\<p>\</p>
\<b>Online Restricted:\</b> The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.

```csharp theme={null}
Task<ErpSyncActorTypeMapping> GetActorTypeMappingAsync(int erpConnectionId, ErpActorType actorType, RequestOptions requestOptions = null)
```

#### Parameters

`erpConnectionId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The ERP connection ID

`actorType` [ErpActorType](SuperOffice.WebApi.Data.ErpActorType.md)

The actor type

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[ErpSyncActorTypeMapping](SuperOffice.WebApi.Data.ErpSyncActorTypeMapping.md)\&gt;

The current mapping from the database

### \<a id="SuperOffice\_WebApi\_Agents\_IErpSyncAgent\_GetAllConnectionsAsync\_System\_Boolean\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetAllConnectionsAsync(bool, RequestOptions)

Returns all ERP Sync connections without config field data. Uses the `ErpConnection` archive.
\<p>\</p>
\<b>Online Restricted:\</b> The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.

```csharp theme={null}
Task<ErpConnection[]> GetAllConnectionsAsync(bool includeDeleted, RequestOptions requestOptions = null)
```

#### Parameters

`includeDeleted` [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

Include deleted connections in the result?

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[ErpConnection](SuperOffice.WebApi.Data.ErpConnection.md)\[]\&gt;

The connection id, name, description

### \<a id="SuperOffice\_WebApi\_Agents\_IErpSyncAgent\_GetAllConnectorsAsync\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetAllConnectorsAsync(RequestOptions)

Returns all ERP Sync connectors. Uses the `ErpConnector` archive.
\<p>\</p>
\<b>Online Restricted:\</b> The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.

```csharp theme={null}
Task<ListItem[]> GetAllConnectorsAsync(RequestOptions requestOptions = null)
```

#### Parameters

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[ListItem](SuperOffice.WebApi.Data.ListItem.md)\[]\&gt;

The connector id, name, url

### \<a id="SuperOffice\_WebApi\_Agents\_IErpSyncAgent\_GetConfigurationFieldsAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetConfigurationFieldsAsync(int, RequestOptions)

Returns all fields needed to connect to the given connector
\<p>\</p>
\<b>Online Restricted:\</b> The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.

```csharp theme={null}
Task<FieldMetadata[]> GetConfigurationFieldsAsync(int erpConnectorId, RequestOptions requestOptions = null)
```

#### Parameters

`erpConnectorId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The id of the erp connector

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[FieldMetadata](SuperOffice.WebApi.Data.FieldMetadata.md)\[]\&gt;

The fields

### \<a id="SuperOffice\_WebApi\_Agents\_IErpSyncAgent\_GetConnectionAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetConnectionAsync(int, RequestOptions)

Returns the specified connection.
\<p>\</p>
\<b>Online Restricted:\</b> The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.

```csharp theme={null}
Task<ErpConnection> GetConnectionAsync(int erpConnectionId, RequestOptions requestOptions = null)
```

#### Parameters

`erpConnectionId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

Primary key of the connection

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[ErpConnection](SuperOffice.WebApi.Data.ErpConnection.md)\&gt;

The connection

### \<a id="SuperOffice\_WebApi\_Agents\_IErpSyncAgent\_GetConnectionListMappingsAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetConnectionListMappingsAsync(int, RequestOptions)

Returns the listmappings for the specified connection.
\<p>\</p>
\<b>Online Restricted:\</b> The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.

```csharp theme={null}
Task<ErpConnectionListMappingContainer> GetConnectionListMappingsAsync(int erpConnectionId, RequestOptions requestOptions = null)
```

#### Parameters

`erpConnectionId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

Primary key of the connection

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[ErpConnectionListMappingContainer](SuperOffice.WebApi.Data.ErpConnectionListMappingContainer.md)\&gt;

The listmappings

### \<a id="SuperOffice\_WebApi\_Agents\_IErpSyncAgent\_GetConnectionsAndDisplayFieldsAsync\_SuperOffice\_WebApi\_Data\_CrmActorType\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetConnectionsAndDisplayFieldsAsync(CrmActorType, int, RequestOptions)

Get all connection statuses and fields for a given entity
\<p>\</p>
\<b>Online Restricted:\</b> The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.

```csharp theme={null}
Task<ErpConnectionData[]> GetConnectionsAndDisplayFieldsAsync(CrmActorType crmActorType, int entityId, RequestOptions requestOptions = null)
```

#### Parameters

`crmActorType` [CrmActorType](SuperOffice.WebApi.Data.CrmActorType.md)

The type of the CRM entity

`entityId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The id of the entity

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[ErpConnectionData](SuperOffice.WebApi.Data.ErpConnectionData.md)\[]\&gt;

An array of ErpConnectionData carriers

### \<a id="SuperOffice\_WebApi\_Agents\_IErpSyncAgent\_GetCrmActorTypeAsync\_System\_Int32\_SuperOffice\_WebApi\_Data\_ErpActorType\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetCrmActorTypeAsync(int, ErpActorType, RequestOptions)

Retrieves the CrmActorType that are mapped to a specific ErpActorType for this connection
\<p>\</p>
\<b>Online Restricted:\</b> The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.

```csharp theme={null}
Task<CrmActorType> GetCrmActorTypeAsync(int erpConnectionId, ErpActorType erpActorType, RequestOptions requestOptions = null)
```

#### Parameters

`erpConnectionId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The ERP connection ID

`erpActorType` [ErpActorType](SuperOffice.WebApi.Data.ErpActorType.md)

The ERP actor type

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[CrmActorType](SuperOffice.WebApi.Data.CrmActorType.md)\&gt;

The CrmActorType

### \<a id="SuperOffice\_WebApi\_Agents\_IErpSyncAgent\_GetDefaultValueInfoAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetDefaultValueInfoAsync(int, RequestOptions)

Get information about default value for an ERP field
\<p>\</p>
\<b>Online Restricted:\</b> The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.

```csharp theme={null}
Task<ErpSyncDefaultValue> GetDefaultValueInfoAsync(int erpFieldId, RequestOptions requestOptions = null)
```

#### Parameters

`erpFieldId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The id of the ERP field

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[ErpSyncDefaultValue](SuperOffice.WebApi.Data.ErpSyncDefaultValue.md)\&gt;

Object with information about default values

### \<a id="SuperOffice\_WebApi\_Agents\_IErpSyncAgent\_GetEngineStatusAsync\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetEngineStatusAsync(RequestOptions)

Get the current status of the Sync engine
\<p>\</p>
\<b>Online Restricted:\</b> The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.

```csharp theme={null}
Task<ErpSyncEngineStatus> GetEngineStatusAsync(RequestOptions requestOptions = null)
```

#### Parameters

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[ErpSyncEngineStatus](SuperOffice.WebApi.Data.ErpSyncEngineStatus.md)\&gt;

The current status of the engine

### \<a id="SuperOffice\_WebApi\_Agents\_IErpSyncAgent\_GetErpConnectionConfigFieldsAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetErpConnectionConfigFieldsAsync(int, RequestOptions)

Returns the config fields for the connection.
\<p>\</p>
\<b>Online Restricted:\</b> The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.

```csharp theme={null}
Task<StringDictionary> GetErpConnectionConfigFieldsAsync(int erpConnectionId, RequestOptions requestOptions = null)
```

#### Parameters

`erpConnectionId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

Primary key of the erp connection

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[StringDictionary](SuperOffice.WebApi.Data.StringDictionary.md)\&gt;

Config Fields

### \<a id="SuperOffice\_WebApi\_Agents\_IErpSyncAgent\_GetErpFieldValuesAsync\_System\_Int32\_SuperOffice\_WebApi\_Data\_CrmActorType\_System\_Int32\_System\_String\_\_\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetErpFieldValuesAsync(int, CrmActorType, int, string\[], RequestOptions)

Get the values for the specified fields from the ERP connection
\<p>\</p>
\<b>Online Restricted:\</b> The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.

```csharp theme={null}
Task<string[]> GetErpFieldValuesAsync(int erpConnectionId, CrmActorType crmActorType, int entityId, string[] fieldKeys, RequestOptions requestOptions = null)
```

#### Parameters

`erpConnectionId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The id of the connection

`crmActorType` [CrmActorType](SuperOffice.WebApi.Data.CrmActorType.md)

The type of the CRM entity

`entityId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The id of the entity

`fieldKeys` [string](https://learn.microsoft.com/dotnet/api/system.string)\[]

The fields for which you want to get the values

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[string](https://learn.microsoft.com/dotnet/api/system.string)\[]\&gt;

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

### \<a id="SuperOffice\_WebApi\_Agents\_IErpSyncAgent\_GetErpSyncConnectionSummaryAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetErpSyncConnectionSummaryAsync(int, RequestOptions)

Get a summary of the current ErpSync configuration/setup
\<p>\</p>
\<b>Online Restricted:\</b> The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.

```csharp theme={null}
Task<ErpSyncConnectionSummary> GetErpSyncConnectionSummaryAsync(int erpSyncConnectionId, RequestOptions requestOptions = null)
```

#### Parameters

`erpSyncConnectionId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The ID of the ErpSync connection for which information is sought

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[ErpSyncConnectionSummary](SuperOffice.WebApi.Data.ErpSyncConnectionSummary.md)\&gt;

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

### \<a id="SuperOffice\_WebApi\_Agents\_IErpSyncAgent\_GetErpSyncConnectorEntityAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetErpSyncConnectorEntityAsync(int, RequestOptions)

Gets a specific ErpSyncConnectorEntity object.
\<p>\</p>
\<b>Online Restricted:\</b> The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.

```csharp theme={null}
Task<ErpSyncConnectorEntity> GetErpSyncConnectorEntityAsync(int erpSyncConnectorEntityId, RequestOptions requestOptions = null)
```

#### Parameters

`erpSyncConnectorEntityId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The identifier of the ErpSyncConnectorEntity object

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[ErpSyncConnectorEntity](SuperOffice.WebApi.Data.ErpSyncConnectorEntity.md)\&gt;

ErpSyncConnectorEntity

### \<a id="SuperOffice\_WebApi\_Agents\_IErpSyncAgent\_GetFieldValuesFromCrmAsync\_System\_Int32\_SuperOffice\_WebApi\_Data\_CrmActorType\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetFieldValuesFromCrmAsync(int, CrmActorType, RequestOptions)

Get Crm Field values
\<p>\</p>
\<b>Online Restricted:\</b> The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.

```csharp theme={null}
Task<ErpSyncFieldValue[]> GetFieldValuesFromCrmAsync(int recordId, CrmActorType actorTypeCrm, RequestOptions requestOptions = null)
```

#### Parameters

`recordId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The id of the CRM entity

`actorTypeCrm` [CrmActorType](SuperOffice.WebApi.Data.CrmActorType.md)

CRM Actor type

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[ErpSyncFieldValue](SuperOffice.WebApi.Data.ErpSyncFieldValue.md)\[]\&gt;

The Crm Fields

### \<a id="SuperOffice\_WebApi\_Agents\_IErpSyncAgent\_GetFieldValuesFromErpAsync\_System\_Int32\_SuperOffice\_WebApi\_Data\_ErpActorType\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetFieldValuesFromErpAsync(int, ErpActorType, string, RequestOptions)

Get Erp Field values
\<p>\</p>
\<b>Online Restricted:\</b> The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.

```csharp theme={null}
Task<ErpSyncFieldValue[]> GetFieldValuesFromErpAsync(int erpConnectionId, ErpActorType actorTypeErp, string erpKey, RequestOptions requestOptions = null)
```

#### Parameters

`erpConnectionId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

Erp connection id

`actorTypeErp` [ErpActorType](SuperOffice.WebApi.Data.ErpActorType.md)

ERP Actor type

`erpKey` [string](https://learn.microsoft.com/dotnet/api/system.string)

Primary key for the erp actor

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[ErpSyncFieldValue](SuperOffice.WebApi.Data.ErpSyncFieldValue.md)\[]\&gt;

The Erp Fields

### \<a id="SuperOffice\_WebApi\_Agents\_IErpSyncAgent\_GetFieldsForNewErpActorAsync\_System\_Int32\_SuperOffice\_WebApi\_Data\_ErpActorType\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetFieldsForNewErpActorAsync(int, ErpActorType, RequestOptions)

Get the fields that must be filled out when creating a new ERP actor
\<p>\</p>
\<b>Online Restricted:\</b> The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.

```csharp theme={null}
Task<FieldMetadata[]> GetFieldsForNewErpActorAsync(int erpConnectionId, ErpActorType erpActorType, RequestOptions requestOptions = null)
```

#### Parameters

`erpConnectionId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The id of the connection

`erpActorType` [ErpActorType](SuperOffice.WebApi.Data.ErpActorType.md)

The type of the ERP actor to create

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[FieldMetadata](SuperOffice.WebApi.Data.FieldMetadata.md)\[]\&gt;

The fields that are required for the new ERP actor

### \<a id="SuperOffice\_WebApi\_Agents\_IErpSyncAgent\_MoveErpFieldItemAsync\_System\_Int32\_System\_Int32\_System\_Int32\_SuperOffice\_WebApi\_Data\_ErpActorType\_SuperOffice\_WebApi\_RequestOptions\_">\</a> MoveErpFieldItemAsync(int, int, int, ErpActorType, RequestOptions)

Moves the rank of the erp field up or down
\<p>\</p>
\<b>Online Restricted:\</b> The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.

```csharp theme={null}
Task MoveErpFieldItemAsync(int erpFieldId, int direction, int erpConnectionId, ErpActorType erpActorType, RequestOptions requestOptions = null)
```

#### Parameters

`erpFieldId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The id of the erp field to move

`direction` [int](https://learn.microsoft.com/dotnet/api/system.int32)

Positive value to increase rank, negative to decrease.

`erpConnectionId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The id of the connection

`erpActorType` [ErpActorType](SuperOffice.WebApi.Data.ErpActorType.md)

The actor type for which we want to rank fields

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### \<a id="SuperOffice\_WebApi\_Agents\_IErpSyncAgent\_SaveActorTypeMappingAsync\_SuperOffice\_WebApi\_Data\_ErpSyncActorTypeMapping\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SaveActorTypeMappingAsync(ErpSyncActorTypeMapping, RequestOptions)

Save mappings for a connection/actor
\<p>\</p>
\<b>Online Restricted:\</b> The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.

```csharp theme={null}
Task<ErpSyncActorTypeMapping> SaveActorTypeMappingAsync(ErpSyncActorTypeMapping mapping, RequestOptions requestOptions = null)
```

#### Parameters

`mapping` [ErpSyncActorTypeMapping](SuperOffice.WebApi.Data.ErpSyncActorTypeMapping.md)

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

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[ErpSyncActorTypeMapping](SuperOffice.WebApi.Data.ErpSyncActorTypeMapping.md)\&gt;

The current mapping from the database

### \<a id="SuperOffice\_WebApi\_Agents\_IErpSyncAgent\_SaveConnectionAsync\_SuperOffice\_WebApi\_Data\_ErpConnection\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SaveConnectionAsync(ErpConnection, RequestOptions)

Saves a connection to the database.
\<p>\</p>
\<b>Online Restricted:\</b> The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.

```csharp theme={null}
Task<ErpConnection> SaveConnectionAsync(ErpConnection connection, RequestOptions requestOptions = null)
```

#### Parameters

`connection` [ErpConnection](SuperOffice.WebApi.Data.ErpConnection.md)

The connection to save.

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[ErpConnection](SuperOffice.WebApi.Data.ErpConnection.md)\&gt;

The resulting connection.

### \<a id="SuperOffice\_WebApi\_Agents\_IErpSyncAgent\_SaveConnectionListMappingsAsync\_SuperOffice\_WebApi\_Data\_ErpConnectionListMappingContainer\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SaveConnectionListMappingsAsync(ErpConnectionListMappingContainer, RequestOptions)

Saves a connection to the database.
\<p>\</p>
\<b>Online Restricted:\</b> The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.

```csharp theme={null}
Task<ErpConnectionListMappingContainer> SaveConnectionListMappingsAsync(ErpConnectionListMappingContainer listMapping, RequestOptions requestOptions = null)
```

#### Parameters

`listMapping` [ErpConnectionListMappingContainer](SuperOffice.WebApi.Data.ErpConnectionListMappingContainer.md)

The list item mappings to save.

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[ErpConnectionListMappingContainer](SuperOffice.WebApi.Data.ErpConnectionListMappingContainer.md)\&gt;

The saved list mappings.

### \<a id="SuperOffice\_WebApi\_Agents\_IErpSyncAgent\_SaveDefaultValueInfoAsync\_SuperOffice\_WebApi\_Data\_ErpSyncDefaultValue\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SaveDefaultValueInfoAsync(ErpSyncDefaultValue, RequestOptions)

Save information about a default value for an ERP field
\<p>\</p>
\<b>Online Restricted:\</b> The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.

```csharp theme={null}
Task<ErpSyncDefaultValue> SaveDefaultValueInfoAsync(ErpSyncDefaultValue erpSyncDefaultValue, RequestOptions requestOptions = null)
```

#### Parameters

`erpSyncDefaultValue` [ErpSyncDefaultValue](SuperOffice.WebApi.Data.ErpSyncDefaultValue.md)

The id of the ERPfield to save

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[ErpSyncDefaultValue](SuperOffice.WebApi.Data.ErpSyncDefaultValue.md)\&gt;

The newly saved ErpSyncDefaultValue

### \<a id="SuperOffice\_WebApi\_Agents\_IErpSyncAgent\_SaveErpConnectionSyncPrioritiesAsync\_System\_Int32\_\_\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SaveErpConnectionSyncPrioritiesAsync(int\[], RequestOptions)

Takes an array of the ErpConnection ids and saves these as ordered sync priorities
\<p>\</p>
\<b>Online Restricted:\</b> The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.

```csharp theme={null}
Task<bool> SaveErpConnectionSyncPrioritiesAsync(int[] erpConnectionIds, RequestOptions requestOptions = null)
```

#### Parameters

`erpConnectionIds` [int](https://learn.microsoft.com/dotnet/api/system.int32)\[]

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

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[bool](https://learn.microsoft.com/dotnet/api/system.boolean)\&gt;

Returns true if new sync priorities is saved

### \<a id="SuperOffice\_WebApi\_Agents\_IErpSyncAgent\_SaveErpSyncConnectorEntityAsync\_SuperOffice\_WebApi\_Data\_ErpSyncConnectorEntity\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SaveErpSyncConnectorEntityAsync(ErpSyncConnectorEntity, RequestOptions)

Updates the existing ErpSyncConnectorEntity or creates a new ErpSyncConnectorEntity if the id parameter is 0.
\<p>\</p>
\<b>Online Restricted:\</b> The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.

```csharp theme={null}
Task<ErpSyncConnectorEntity> SaveErpSyncConnectorEntityAsync(ErpSyncConnectorEntity erpSyncConnectorEntity, RequestOptions requestOptions = null)
```

#### Parameters

`erpSyncConnectorEntity` [ErpSyncConnectorEntity](SuperOffice.WebApi.Data.ErpSyncConnectorEntity.md)

The ErpSyncConnectorEntity that is saved.

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[ErpSyncConnectorEntity](SuperOffice.WebApi.Data.ErpSyncConnectorEntity.md)\&gt;

New or updated ErpSyncConnectorEntity

### \<a id="SuperOffice\_WebApi\_Agents\_IErpSyncAgent\_SupportsAdvancedSearchAsync\_System\_Int32\_SuperOffice\_WebApi\_Data\_ErpActorType\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SupportsAdvancedSearchAsync(int, ErpActorType, RequestOptions)

Indicates if the connection supports advanced search for the given erp actor
\<p>\</p>
\<b>Online Restricted:\</b> The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.

```csharp theme={null}
Task<bool> SupportsAdvancedSearchAsync(int erpConnectionId, ErpActorType erpActorType, RequestOptions requestOptions = null)
```

#### Parameters

`erpConnectionId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

Ths id of the connection

`erpActorType` [ErpActorType](SuperOffice.WebApi.Data.ErpActorType.md)

The erp actor type to check for

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[bool](https://learn.microsoft.com/dotnet/api/system.boolean)\&gt;

True if advanced search is supported

### \<a id="SuperOffice\_WebApi\_Agents\_IErpSyncAgent\_SyncAllAsync\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SyncAllAsync(RequestOptions)

Sync all active connections
\<p>\</p>
\<b>Online Restricted:\</b> The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.

```csharp theme={null}
Task<PluginResponse> SyncAllAsync(RequestOptions requestOptions = null)
```

#### Parameters

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[PluginResponse](SuperOffice.WebApi.Data.PluginResponse.md)\&gt;

The response

### \<a id="SuperOffice\_WebApi\_Agents\_IErpSyncAgent\_TestConnectionByConfigAsync\_System\_Int32\_SuperOffice\_WebApi\_Data\_StringDictionary\_SuperOffice\_WebApi\_RequestOptions\_">\</a> TestConnectionByConfigAsync(int, StringDictionary, RequestOptions)

Tests to see if the given connection has a valid connection to its connector
\<p>\</p>
\<b>Online Restricted:\</b> The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.

```csharp theme={null}
Task<bool> TestConnectionByConfigAsync(int erpConnectionId, StringDictionary configFields, RequestOptions requestOptions = null)
```

#### Parameters

`erpConnectionId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The id of the connector we try to connect to

`configFields` [StringDictionary](SuperOffice.WebApi.Data.StringDictionary.md)

The config fields used to test connection

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[bool](https://learn.microsoft.com/dotnet/api/system.boolean)\&gt;

Returns true if success

### \<a id="SuperOffice\_WebApi\_Agents\_IErpSyncAgent\_TestConnectionByIdAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> TestConnectionByIdAsync(int, RequestOptions)

Tests to see if we can establish a connection with the given config fields
\<p>\</p>
\<b>Online Restricted:\</b> The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.

```csharp theme={null}
Task<bool> TestConnectionByIdAsync(int erpConnectionId, RequestOptions requestOptions = null)
```

#### Parameters

`erpConnectionId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The id of the connection

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[bool](https://learn.microsoft.com/dotnet/api/system.boolean)\&gt;

Returns true if success

### \<a id="SuperOffice\_WebApi\_Agents\_IErpSyncAgent\_TestConnectorUrlAsync\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> TestConnectorUrlAsync(string, RequestOptions)

Test if connector urls anwers
\<p>\</p>
\<b>Online Restricted:\</b> The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.

```csharp theme={null}
Task<ErpSyncResponseCode> TestConnectorUrlAsync(string url, RequestOptions requestOptions = null)
```

#### Parameters

`url` [string](https://learn.microsoft.com/dotnet/api/system.string)

The url to test connection on

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[ErpSyncResponseCode](SuperOffice.WebApi.Data.ErpSyncResponseCode.md)\&gt;

Enum response says ok or what is wrong

### \<a id="SuperOffice\_WebApi\_Agents\_IErpSyncAgent\_ToggleErpConnectionActiveAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> ToggleErpConnectionActiveAsync(int, RequestOptions)

Toggles the Active state of the connection
\<p>\</p>
\<b>Online Restricted:\</b> The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.

```csharp theme={null}
Task<string[]> ToggleErpConnectionActiveAsync(int erpConnectionId, RequestOptions requestOptions = null)
```

#### Parameters

`erpConnectionId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

Primary key of the erp connection

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[string](https://learn.microsoft.com/dotnet/api/system.string)\[]\&gt;

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

### \<a id="SuperOffice\_WebApi\_Agents\_IErpSyncAgent\_TryConnectActorAsync\_System\_Int32\_System\_Int32\_SuperOffice\_WebApi\_Data\_CrmActorType\_System\_String\_SuperOffice\_WebApi\_Data\_ErpActorType\_SuperOffice\_WebApi\_Data\_ErpSyncFieldValue\_\_\_SuperOffice\_WebApi\_RequestOptions\_">\</a> TryConnectActorAsync(int, int, CrmActorType, string, ErpActorType, ErpSyncFieldValue\[], RequestOptions)

Create a link between Erp and Crm and set default values
\<p>\</p>
\<b>Online Restricted:\</b> The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.

```csharp theme={null}
Task<bool> TryConnectActorAsync(int erpConnectionId, int crmRecordId, CrmActorType crmActorType, string erpKey, ErpActorType erpActorType, ErpSyncFieldValue[] fieldValues, RequestOptions requestOptions = null)
```

#### Parameters

`erpConnectionId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

ErpConnectionId

`crmRecordId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

CrmRecordId

`crmActorType` [CrmActorType](SuperOffice.WebApi.Data.CrmActorType.md)

The Crm Actor type

`erpKey` [string](https://learn.microsoft.com/dotnet/api/system.string)

`erpActorType` [ErpActorType](SuperOffice.WebApi.Data.ErpActorType.md)

The Erp Actor type

`fieldValues` [ErpSyncFieldValue](SuperOffice.WebApi.Data.ErpSyncFieldValue.md)\[]

The Crm Fields

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[bool](https://learn.microsoft.com/dotnet/api/system.boolean)\&gt;

### \<a id="SuperOffice\_WebApi\_Agents\_IErpSyncAgent\_UpdateConnectionFieldsAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> UpdateConnectionFieldsAsync(int, RequestOptions)

Gets all supported actor types, and all fields for each actor type, and save this state to the CRM database
\<p>\</p>
\<b>Online Restricted:\</b> The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.

```csharp theme={null}
Task<bool> UpdateConnectionFieldsAsync(int erpConnectionId, RequestOptions requestOptions = null)
```

#### Parameters

`erpConnectionId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The ERP connection ID

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[bool](https://learn.microsoft.com/dotnet/api/system.boolean)\&gt;

Success or fail

### \<a id="SuperOffice\_WebApi\_Agents\_IErpSyncAgent\_ValidateArchiveColumnConfigAsync\_System\_String\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> ValidateArchiveColumnConfigAsync(string, int, RequestOptions)

Clear field info from table SUPERLISTCOLUMNSIZE if field mapping changed on given connection
\<p>\</p>
\<b>Online Restricted:\</b> The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.

```csharp theme={null}
Task ValidateArchiveColumnConfigAsync(string listOwner, int erpConnectionId, RequestOptions requestOptions = null)
```

#### Parameters

`listOwner` [string](https://learn.microsoft.com/dotnet/api/system.string)

GUI name used in archive control config

`erpConnectionId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The ERP connection ID

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

Validated ArchiveColumnConfig
