Class CrmConnectionHandlerFacade
Inheritance
CrmConnectionHandlerFacade
Assembly: SuperOffice.Services.Implementation.dll
Syntax
public class CrmConnectionHandlerFacade : ConnectionHandlerFacadeBase
Methods
CreateActorAsync(ErpSyncActor, ErpActorType)
Creates a new actor and returns the actor from the connection as if looks after the create operation (e.g. with a new ErpKey and timestamp, etc)
Declaration
public override Task<ErpSyncActor> CreateActorAsync(ErpSyncActor act, ErpActorType actorType)
Parameters
Type |
Name |
Description |
ErpSyncActor |
act |
|
ErpActorType |
actorType |
|
Returns
Overrides
GetActorAsync(int, int)
Declaration
public Task<ErpSyncActor> GetActorAsync(int recordId, int tableId)
Parameters
Type |
Name |
Description |
int |
recordId |
|
int |
tableId |
|
Returns
GetActorsAsync(ErpActorType, string[])
Retrieves a specified set of actors. Will use the field mapping for the given actor type and connection.
Declaration
public override Task<ErpSyncActor[]> GetActorsAsync(ErpActorType actorType, string[] CrmKeys)
Parameters
Type |
Name |
Description |
ErpActorType |
actorType |
|
string[] |
CrmKeys |
|
Returns
Overrides
GetConfigDataAsync()
Declaration
protected override Task<FieldMetadataInfo[]> GetConfigDataAsync()
Returns
Type |
Description |
Task<FieldMetadataInfo[]> |
|
Overrides
GetConnectionIdAsync()
The connection ID identifying the CRM connection internally in EIS. Because we can only ever have one CRM connection, and because we don't need to store
the connection configuration data anywhere, this GUID does not have to persist between sessions, and can be generated every time the connection is opened.
Declaration
public override Task<Guid> GetConnectionIdAsync()
Returns
Overrides
GetCrmActorTypeFromInternalKeyIdAsync(int, CancellationToken)
Declaration
public static Task<CrmActorType> GetCrmActorTypeFromInternalKeyIdAsync(int internalKeyId, CancellationToken cancellationToken = default)
Parameters
Returns
Type |
Description |
Task<CrmActorType> |
|
GetCrmActorTypeFromTableId(int)
Declaration
public static CrmActorType GetCrmActorTypeFromTableId(int tableId)
Parameters
Type |
Name |
Description |
int |
tableId |
|
Returns
Type |
Description |
CrmActorType |
|
GetErpConnectionIdAsync()
The CRM connection does not have an ErpConnectionId. This method will always return 0
Declaration
public override Task<int> GetErpConnectionIdAsync()
Returns
Overrides
GetInternalKeyAsync(int, int, CancellationToken)
Declaration
public static Task<int> GetInternalKeyAsync(int recordId, int tableId, CancellationToken cancellationToken = default)
Parameters
Returns
GetListAsync(string)
Retrieves an entire list with a given name
Declaration
public override Task<Dictionary<string, string>> GetListAsync(string listName)
Parameters
Type |
Name |
Description |
string |
listName |
|
Returns
Overrides
GetListItemsAsync(string, string[])
Retrieves a specific set of list items from a given list
Declaration
public override Task<Dictionary<string, string>> GetListItemsAsync(string listName, string[] listItemKeys)
Parameters
Returns
Overrides
GetSupportedActorTypeFieldsAsync(ErpActorType)
Retrieves supported fields for a specific actor type
Declaration
public override Task<FieldMetadataInfo[]> GetSupportedActorTypeFieldsAsync(ErpActorType actorType)
Parameters
Type |
Name |
Description |
ErpActorType |
actorType |
|
Returns
Type |
Description |
Task<FieldMetadataInfo[]> |
|
Overrides
GetSupportedActorTypesAsync()
Retrieves supported actor types for the CRM connection
Declaration
public override Task<string[]> GetSupportedActorTypesAsync()
Returns
Overrides
GetTableIdFromCrmActorType(CrmActorType)
Declaration
public static int GetTableIdFromCrmActorType(CrmActorType crmActTp)
Parameters
Type |
Name |
Description |
CrmActorType |
crmActTp |
|
Returns
GetUpdatedActorsAsync()
Retrieves an entire list with a given name
Declaration
public override Task<ErpSyncActor[]> GetUpdatedActorsAsync()
Returns
Overrides
OpenConnectionAsync(CancellationToken)
Opens or retrieves the CRM connection handler
Declaration
public static Task<CrmConnectionHandlerFacade> OpenConnectionAsync(CancellationToken cancellationToken = default)
Parameters
Returns
SaveActorTimestampAsync(ErpSyncActor, CancellationToken)
If the timestamp of the given actor is larger than the currently stored timestamp from the database (ErpExternalKey row), the new timestamp is stored to the database.
Declaration
public override Task SaveActorTimestampAsync(ErpSyncActor act, CancellationToken cancellationToken = default)
Parameters
Returns
Overrides
SaveActorsAsync(ErpSyncActor[])
Saves a set of actors to the connection and returns those same actors with their updated values from the ERP system (new timestamp, possibly new field values, etc)
Declaration
public override Task<ErpSyncActor[]> SaveActorsAsync(ErpSyncActor[] actors)
Parameters
Returns
Overrides
SaveActorsAsync(ErpSyncActor[], bool)
Saves a set of actors to the connection and returns those same actors with their updated values from the ERP system (new timestamp, possibly new field values, etc)
Declaration
public override Task<ErpSyncActor[]> SaveActorsAsync(ErpSyncActor[] actors, bool noBlankValues)
Parameters
Returns
Overrides
SaveConnectionAsync(Dictionary<string, string>)
Declaration
public override Task<PluginResponseInfo> SaveConnectionAsync(Dictionary<string, string> connectionInfo)
Parameters
Returns
Type |
Description |
Task<PluginResponseInfo> |
|
Overrides
SaveConnectionTimestampAsync(ErpSyncActor, CancellationToken)
If the timestamp of the given actor is larger than the currently stored timestamp from the database (ErpInternalKey row), the new timestamp is stored to the database.
Declaration
public override Task SaveConnectionTimestampAsync(ErpSyncActor act, CancellationToken cancellationToken = default)
Parameters
Returns
Overrides
SearchActorByParentAsync(ErpActorType, string, ErpActorType, string)
Searches for actors with a specified parent actor using a given search string. Will use the field mapping for the given actor type and connection.
Declaration
public override Task<ErpSyncActor[]> SearchActorByParentAsync(ErpActorType actorType, string searchText, ErpActorType parentActorType, string parentActorErpKey)
Parameters
Type |
Name |
Description |
ErpActorType |
actorType |
|
string |
searchText |
|
ErpActorType |
parentActorType |
|
string |
parentActorErpKey |
|
Returns
Overrides
SearchActorsAsync(ErpActorType, string)
Searches for actors using a given search string. Will use the field mapping for the given actor type and connection.
Declaration
public override Task<ErpSyncActor[]> SearchActorsAsync(ErpActorType actorType, string searchText)
Parameters
Type |
Name |
Description |
ErpActorType |
actorType |
|
string |
searchText |
|
Returns
Overrides
SearchActorsAsync(ErpActorType, string, string[])
Declaration
public override Task<ErpSyncActor[]> SearchActorsAsync(ErpActorType actorType, string searchText, string[] fieldKeys)
Parameters
Type |
Name |
Description |
ErpActorType |
actorType |
|
string |
searchText |
|
string[] |
fieldKeys |
|
Returns
Overrides
SetConnectionIdAsync(Guid)
The connection ID identifying the CRM connection internally in EIS. Because we can only ever have one CRM connection, and because we don't need to store
the connection configuration data anywhere, this GUID does not have to persist between sessions, and can be generated every time the connection is opened.
Declaration
protected override Task SetConnectionIdAsync(Guid value)
Parameters
Type |
Name |
Description |
Guid |
value |
|
Returns
Overrides
SetErpConnectionIdAsync(int)
The CRM connection does not have an ErpConnectionId. This method will always return 0
Declaration
protected override Task SetErpConnectionIdAsync(int value)
Parameters
Type |
Name |
Description |
int |
value |
|
Returns
Overrides
TestConnectionAsync()
Checks to see if the connection is active
Declaration
public override Task<PluginResponseInfo> TestConnectionAsync()
Returns
Type |
Description |
Task<PluginResponseInfo> |
|
Overrides