Class ErpSyncAgent
Facade for the ErpSync Agent Services for the ERP Integration Services feature
Online Restricted: This agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.Namespace: SuperOffice.CRM.Services
Assembly: SuperOffice.Services.dll
Syntax
public class ErpSyncAgent : AgentBase<IErpSyncAgent>, IDisposable, IErpSyncAgent, IAgent
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (ErpSyncAgent agent = new ErpSyncAgent())
{
// call methods on agent here...
}
}
Constructors
ErpSyncAgent()
Facade for the ErpSync Agent Services for the ERP Integration Services feature
Online Restricted: This agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.Declaration
public ErpSyncAgent()
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (ErpSyncAgent agent = new ErpSyncAgent())
{
// call methods on agent here...
}
}
Methods
BreakActorLink(Int32, Int32, CrmActorType)
Remove the link between a CRM entity and an ERP entity
Declaration
public bool BreakActorLink(int erpConnectionId, int crmRecordId, CrmActorType crmActorType)
Parameters
Type | Name | Description |
---|---|---|
Int32 | erpConnectionId | The ERP connection ID |
Int32 | crmRecordId | The ID of the CRM entity to connect to |
CrmActorType | crmActorType | Identifies the CRM actor type corresponding to this CRM entity |
Returns
Type | Description |
---|---|
Boolean | True if success |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (ErpSyncAgent agent = new ErpSyncAgent())
{
// call methods on agent here...
}
}
CanDeleteErpSyncConnectorEntity(Int32)
Can we delete the connector?
Declaration
public ErpSyncResponseCode CanDeleteErpSyncConnectorEntity(int erpSyncConnectorId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | erpSyncConnectorId | The ID of the ErpSync connector to check if can be deleted |
Returns
Type | Description |
---|---|
ErpSyncResponseCode | Enum response says ok or what is wrong |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (ErpSyncAgent agent = new ErpSyncAgent())
{
// call methods on agent here...
}
}
ChangeEngineInterval(TimeSpan)
Change the interval for each run of the Sync Engine
Declaration
public void ChangeEngineInterval(TimeSpan interval)
Parameters
Type | Name | Description |
---|---|---|
TimeSpan | interval | The run interval for the engine |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (ErpSyncAgent agent = new ErpSyncAgent())
{
// call methods on agent here...
}
}
ChangeEngineStatus(Boolean)
Change the current running/stopped status of the Sync engine
Declaration
public ErpSyncEngineStatus ChangeEngineStatus(bool run)
Parameters
Type | Name | Description |
---|---|---|
Boolean | run | If true, then start the engine; otherwise stop it (requests to the Batch system, may not be immediately reflected) |
Returns
Type | Description |
---|---|
ErpSyncEngineStatus | The current status of the engine |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (ErpSyncAgent agent = new ErpSyncAgent())
{
// call methods on agent here...
}
}
ConnectActor(Int32, Int32, CrmActorType, String, ErpActorType, ErpSyncFieldValue[])
Create a link between Erp and Crm and set default values
Declaration
public void ConnectActor(int erpConnectionId, int crmRecordId, CrmActorType crmActorType, string erpKey, ErpActorType erpActorType, ErpSyncFieldValue[] fieldValues)
Parameters
Type | Name | Description |
---|---|---|
Int32 | erpConnectionId | ErpConnectionId |
Int32 | crmRecordId | CrmRecordId |
CrmActorType | crmActorType | The Crm Actor type |
String | erpKey | |
ErpActorType | erpActorType | The Erp Actor type |
ErpSyncFieldValue[] | fieldValues | The Crm Fields |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (ErpSyncAgent agent = new ErpSyncAgent())
{
// call methods on agent here...
}
}
CreateActorLink(Int32, Int32, CrmActorType, String, ErpActorType)
Link a crm entity to an erp entity
Declaration
public bool CreateActorLink(int erpConnectionId, int crmRecordId, CrmActorType crmActorType, string erpKey, ErpActorType erpActorType)
Parameters
Type | Name | Description |
---|---|---|
Int32 | erpConnectionId | The ERP connection ID |
Int32 | 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 |
Returns
Type | Description |
---|---|
Boolean | True if success |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (ErpSyncAgent agent = new ErpSyncAgent())
{
// call methods on agent here...
}
}
CreateDefaultErpSyncConnectorEntity()
Loading default values into a new ErpSyncConnectorEntity. NetServer calculates default values (e.g. Country) on the entity, which is required when creating/storing a new instance
Declaration
public ErpSyncConnectorEntity CreateDefaultErpSyncConnectorEntity()
Returns
Type | Description |
---|---|
ErpSyncConnectorEntity | New ErpSyncConnectorEntity with default values |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (ErpSyncAgent agent = new ErpSyncAgent())
{
// call methods on agent here...
}
}
CreateErpActorFromCrm(Int32, Int32, ErpActorType, CrmActorType, StringDictionary)
Create ErpActor from crm entity
Declaration
public bool CreateErpActorFromCrm(int connectionId, int crmEntityId, ErpActorType erpActorType, CrmActorType crmActorType, StringDictionary erpFieldKeyValues)
Parameters
Type | Name | Description |
---|---|---|
Int32 | connectionId | The connection ID |
Int32 | 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 |
Returns
Type | Description |
---|---|
Boolean | Created ERP actor with success |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (ErpSyncAgent agent = new ErpSyncAgent())
{
// call methods on agent here...
}
}
DeleteConnection(Int32)
Deletes a connection from the database.
Declaration
public void DeleteConnection(int erpConnectionId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | erpConnectionId | Primary key of the connection |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (ErpSyncAgent agent = new ErpSyncAgent())
{
// call methods on agent here...
}
}
DeleteErpSyncConnectorEntity(Int32)
Deletes the ErpSyncConnectorEntity
Declaration
public void DeleteErpSyncConnectorEntity(int erpSyncConnectorEntityId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | erpSyncConnectorEntityId | The identity of the ErpSyncConnectorEntity |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (ErpSyncAgent agent = new ErpSyncAgent())
{
// call methods on agent here...
}
}
ForceResync(Int32, Int32[])
Force resync from CRM or given Erp connection to all other connections
Declaration
public PluginResponse ForceResync(int erpConnectionId, int[] internalKeyIds)
Parameters
Type | Name | Description |
---|---|---|
Int32 | erpConnectionId | If positive, resync from the given erp connection |
Int32[] | internalKeyIds | The internal keys of the entities to resync, or empty to resync all |
Returns
Type | Description |
---|---|
PluginResponse | The response |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (ErpSyncAgent agent = new ErpSyncAgent())
{
// call methods on agent here...
}
}
ForceResyncBatchTask(Int32, Int32[])
Start batch task to force resync from CRM or given Erp connection to all other connections
Declaration
public void ForceResyncBatchTask(int erpConnectionId, int[] internalKeyIds)
Parameters
Type | Name | Description |
---|---|---|
Int32 | erpConnectionId | If positive, resync from the given erp connection |
Int32[] | internalKeyIds | The internal keys of the entities to resync, or empty to resync all |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (ErpSyncAgent agent = new ErpSyncAgent())
{
// call methods on agent here...
}
}
ForceResyncExternal(Int32, ErpActorType, String[])
Force resync from CRM or given Erp connection to all other connections, using external keys
Declaration
public PluginResponse ForceResyncExternal(int erpConnectionId, ErpActorType erpActorType, string[] externalKeys)
Parameters
Type | Name | Description |
---|---|---|
Int32 | 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 |
Returns
Type | Description |
---|---|
PluginResponse | The response |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (ErpSyncAgent agent = new ErpSyncAgent())
{
// call methods on agent here...
}
}
ForceResyncExternalNoBlankValues(Int32, ErpActorType, String[])
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 PluginResponse ForceResyncExternalNoBlankValues(int erpConnectionId, ErpActorType erpActorType, string[] externalKeys)
Parameters
Type | Name | Description |
---|---|---|
Int32 | 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 |
Returns
Type | Description |
---|---|
PluginResponse | The response |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (ErpSyncAgent agent = new ErpSyncAgent())
{
// call methods on agent here...
}
}
ForceResyncNoBlankValues(Int32, Int32[])
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 PluginResponse ForceResyncNoBlankValues(int erpConnectionId, int[] internalKeyIds)
Parameters
Type | Name | Description |
---|---|---|
Int32 | erpConnectionId | If positive, resync from the given erp connection |
Int32[] | internalKeyIds | The internal keys of the entities to resync, or empty to resync all |
Returns
Type | Description |
---|---|
PluginResponse | The response |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (ErpSyncAgent agent = new ErpSyncAgent())
{
// call methods on agent here...
}
}
ForceSyncAll()
Sync all active connections even when automatic sync is off
Declaration
public PluginResponse ForceSyncAll()
Returns
Type | Description |
---|---|
PluginResponse | The response |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (ErpSyncAgent agent = new ErpSyncAgent())
{
// call methods on agent here...
}
}
GetActorTypeMapping(Int32, ErpActorType)
Get the current mappings for one connection/actor; connection+actor type = unique key
Declaration
public ErpSyncActorTypeMapping GetActorTypeMapping(int erpConnectionId, ErpActorType actorType)
Parameters
Type | Name | Description |
---|---|---|
Int32 | erpConnectionId | The ERP connection ID |
ErpActorType | actorType | The actor type |
Returns
Type | Description |
---|---|
ErpSyncActorTypeMapping | The current mapping from the database |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (ErpSyncAgent agent = new ErpSyncAgent())
{
// call methods on agent here...
}
}
GetAllConnections(Boolean)
Returns all ERP Sync connections without config field data. Uses the ErpConnection
archive.
Declaration
public ErpConnection[] GetAllConnections(bool includeDeleted)
Parameters
Type | Name | Description |
---|---|---|
Boolean | includeDeleted | Include deleted connections in the result? |
Returns
Type | Description |
---|---|
ErpConnection[] | The connection id, name, description |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (ErpSyncAgent agent = new ErpSyncAgent())
{
// call methods on agent here...
}
}
GetAllConnectors()
Returns all ERP Sync connectors. Uses the ErpConnector
archive.
Declaration
public ListItem[] GetAllConnectors()
Returns
Type | Description |
---|---|
ListItem[] | The connector id, name, url |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (ErpSyncAgent agent = new ErpSyncAgent())
{
// call methods on agent here...
}
}
GetConfigurationFields(Int32)
Returns all fields needed to connect to the given connector
Declaration
public FieldMetadata[] GetConfigurationFields(int erpConnectorId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | erpConnectorId | The id of the erp connector |
Returns
Type | Description |
---|---|
FieldMetadata[] | The fields |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (ErpSyncAgent agent = new ErpSyncAgent())
{
// call methods on agent here...
}
}
GetConnection(Int32)
Returns the specified connection.
Declaration
public ErpConnection GetConnection(int erpConnectionId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | erpConnectionId | Primary key of the connection |
Returns
Type | Description |
---|---|
ErpConnection | The connection |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (ErpSyncAgent agent = new ErpSyncAgent())
{
// call methods on agent here...
}
}
GetConnectionListMappings(Int32)
Returns the listmappings for the specified connection.
Declaration
public ErpConnectionListMappingContainer GetConnectionListMappings(int erpConnectionId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | erpConnectionId | Primary key of the connection |
Returns
Type | Description |
---|---|
ErpConnectionListMappingContainer | The listmappings |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (ErpSyncAgent agent = new ErpSyncAgent())
{
// call methods on agent here...
}
}
GetConnectionsAndDisplayFields(CrmActorType, Int32)
Get all connection statuses and fields for a given entity
Declaration
public ErpConnectionData[] GetConnectionsAndDisplayFields(CrmActorType crmActorType, int entityId)
Parameters
Type | Name | Description |
---|---|---|
CrmActorType | crmActorType | The type of the CRM entity |
Int32 | entityId | The id of the entity |
Returns
Type | Description |
---|---|
ErpConnectionData[] | An array of ErpConnectionData carriers |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (ErpSyncAgent agent = new ErpSyncAgent())
{
// call methods on agent here...
}
}
GetCrmActorType(Int32, ErpActorType)
Retrieves the CrmActorType that are mapped to a specific ErpActorType for this connection
Declaration
public CrmActorType GetCrmActorType(int erpConnectionId, ErpActorType erpActorType)
Parameters
Type | Name | Description |
---|---|---|
Int32 | erpConnectionId | The ERP connection ID |
ErpActorType | erpActorType | The ERP actor type |
Returns
Type | Description |
---|---|
CrmActorType | The CrmActorType |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (ErpSyncAgent agent = new ErpSyncAgent())
{
// call methods on agent here...
}
}
GetDefaultValueInfo(Int32)
Get information about default value for an ERP field
Declaration
public ErpSyncDefaultValue GetDefaultValueInfo(int erpFieldId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | erpFieldId | The id of the ERP field |
Returns
Type | Description |
---|---|
ErpSyncDefaultValue | Object with information about default values |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (ErpSyncAgent agent = new ErpSyncAgent())
{
// call methods on agent here...
}
}
GetEngineStatus()
Get the current status of the Sync engine
Declaration
public ErpSyncEngineStatus GetEngineStatus()
Returns
Type | Description |
---|---|
ErpSyncEngineStatus | The current status of the engine |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (ErpSyncAgent agent = new ErpSyncAgent())
{
// call methods on agent here...
}
}
GetErpConnectionConfigFields(Int32)
Returns the config fields for the connection.
Declaration
public StringDictionary GetErpConnectionConfigFields(int erpConnectionId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | erpConnectionId | Primary key of the erp connection |
Returns
Type | Description |
---|---|
StringDictionary | Config Fields |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (ErpSyncAgent agent = new ErpSyncAgent())
{
// call methods on agent here...
}
}
GetErpFieldValues(Int32, CrmActorType, Int32, String[])
Get the values for the specified fields from the ERP connection
Declaration
public string[] GetErpFieldValues(int erpConnectionId, CrmActorType crmActorType, int entityId, string[] fieldKeys)
Parameters
Type | Name | Description |
---|---|---|
Int32 | erpConnectionId | The id of the connection |
CrmActorType | crmActorType | The type of the CRM entity |
Int32 | entityId | The id of the entity |
String[] | fieldKeys | The fields for which you want to get the values |
Returns
Type | Description |
---|---|
String[] | An array containing the values for the specified fields, in the same order |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (ErpSyncAgent agent = new ErpSyncAgent())
{
// call methods on agent here...
}
}
GetErpSyncConnectionSummary(Int32)
Get a summary of the current ErpSync configuration/setup
Declaration
public ErpSyncConnectionSummary GetErpSyncConnectionSummary(int erpSyncConnectionId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | erpSyncConnectionId | The ID of the ErpSync connection for which information is sought |
Returns
Type | Description |
---|---|
ErpSyncConnectionSummary | Summary of connection information, and one summary element per configured actor type |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (ErpSyncAgent agent = new ErpSyncAgent())
{
// call methods on agent here...
}
}
GetErpSyncConnectorEntity(Int32)
Gets a ErpSyncConnectorEntity object.
Declaration
public ErpSyncConnectorEntity GetErpSyncConnectorEntity(int erpSyncConnectorEntityId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | erpSyncConnectorEntityId | The identifier of the ErpSyncConnectorEntity object |
Returns
Type | Description |
---|---|
ErpSyncConnectorEntity | ErpSyncConnectorEntity |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (ErpSyncAgent agent = new ErpSyncAgent())
{
// call methods on agent here...
}
}
GetFieldsForNewErpActor(Int32, ErpActorType)
Get the fields that must be filled out when creating a new ERP actor
Declaration
public FieldMetadata[] GetFieldsForNewErpActor(int erpConnectionId, ErpActorType erpActorType)
Parameters
Type | Name | Description |
---|---|---|
Int32 | erpConnectionId | The id of the connection |
ErpActorType | erpActorType | The type of the ERP actor to create |
Returns
Type | Description |
---|---|
FieldMetadata[] | The fields that are required for the new ERP actor |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (ErpSyncAgent agent = new ErpSyncAgent())
{
// call methods on agent here...
}
}
GetFieldValuesFromCrm(Int32, CrmActorType)
Get Crm Field values
Declaration
public ErpSyncFieldValue[] GetFieldValuesFromCrm(int recordId, CrmActorType actorTypeCrm)
Parameters
Type | Name | Description |
---|---|---|
Int32 | recordId | The id of the CRM entity |
CrmActorType | actorTypeCrm | CRM Actor type |
Returns
Type | Description |
---|---|
ErpSyncFieldValue[] | The Crm Fields |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (ErpSyncAgent agent = new ErpSyncAgent())
{
// call methods on agent here...
}
}
GetFieldValuesFromErp(Int32, ErpActorType, String)
Get Erp Field values
Declaration
public ErpSyncFieldValue[] GetFieldValuesFromErp(int erpConnectionId, ErpActorType actorTypeErp, string erpKey)
Parameters
Type | Name | Description |
---|---|---|
Int32 | erpConnectionId | Erp connection id |
ErpActorType | actorTypeErp | ERP Actor type |
String | erpKey | Primary key for the erp actor |
Returns
Type | Description |
---|---|
ErpSyncFieldValue[] | The Erp Fields |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (ErpSyncAgent agent = new ErpSyncAgent())
{
// call methods on agent here...
}
}
MoveErpFieldItem(Int32, Int32, Int32, ErpActorType)
Moves the rank of the erp field up or down
Declaration
public void MoveErpFieldItem(int erpFieldId, int direction, int erpConnectionId, ErpActorType erpActorType)
Parameters
Type | Name | Description |
---|---|---|
Int32 | erpFieldId | The id of the erp field to move |
Int32 | direction | Positive value to increase rank, negative to decrease. |
Int32 | erpConnectionId | The id of the connection |
ErpActorType | erpActorType | The actor type for which we want to rank fields |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (ErpSyncAgent agent = new ErpSyncAgent())
{
// call methods on agent here...
}
}
SaveActorTypeMapping(ErpSyncActorTypeMapping)
Save mappings for a connection/actor
Declaration
public ErpSyncActorTypeMapping SaveActorTypeMapping(ErpSyncActorTypeMapping mapping)
Parameters
Type | Name | Description |
---|---|---|
ErpSyncActorTypeMapping | mapping | The mapping to be saved; new mapping rows will be created in the database if needed |
Returns
Type | Description |
---|---|
ErpSyncActorTypeMapping | The current mapping from the database |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (ErpSyncAgent agent = new ErpSyncAgent())
{
// call methods on agent here...
}
}
SaveConnection(ErpConnection)
Saves a connection to the database.
Declaration
public ErpConnection SaveConnection(ErpConnection connection)
Parameters
Type | Name | Description |
---|---|---|
ErpConnection | connection | The connection to save. |
Returns
Type | Description |
---|---|
ErpConnection | The resulting connection. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (ErpSyncAgent agent = new ErpSyncAgent())
{
// call methods on agent here...
}
}
SaveConnectionListMappings(ErpConnectionListMappingContainer)
Saves a connection to the database.
Declaration
public ErpConnectionListMappingContainer SaveConnectionListMappings(ErpConnectionListMappingContainer listMapping)
Parameters
Type | Name | Description |
---|---|---|
ErpConnectionListMappingContainer | listMapping | The list item mappings to save. |
Returns
Type | Description |
---|---|
ErpConnectionListMappingContainer | The saved list mappings. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (ErpSyncAgent agent = new ErpSyncAgent())
{
// call methods on agent here...
}
}
SaveDefaultValueInfo(ErpSyncDefaultValue)
Save information about a default value for an ERP field
Declaration
public ErpSyncDefaultValue SaveDefaultValueInfo(ErpSyncDefaultValue erpSyncDefaultValue)
Parameters
Type | Name | Description |
---|---|---|
ErpSyncDefaultValue | erpSyncDefaultValue | The id of the ERPfield to save |
Returns
Type | Description |
---|---|
ErpSyncDefaultValue | The newly saved ErpSyncDefaultValue |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (ErpSyncAgent agent = new ErpSyncAgent())
{
// call methods on agent here...
}
}
SaveErpConnectionSyncPriorities(Int32[])
Takes an array of the ErpConnection ids and saves these as ordered sync priorities
Declaration
public bool SaveErpConnectionSyncPriorities(int[] erpConnectionIds)
Parameters
Type | Name | Description |
---|---|---|
Int32[] | erpConnectionIds | The id put in array in the same order as the priorities |
Returns
Type | Description |
---|---|
Boolean | Returns true if new sync priorities is saved |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (ErpSyncAgent agent = new ErpSyncAgent())
{
// call methods on agent here...
}
}
SaveErpSyncConnectorEntity(ErpSyncConnectorEntity)
Updates the existing ErpSyncConnectorEntity or creates a new ErpSyncConnectorEntity if the id parameter is empty
Declaration
public ErpSyncConnectorEntity SaveErpSyncConnectorEntity(ErpSyncConnectorEntity erpSyncConnectorEntity)
Parameters
Type | Name | Description |
---|---|---|
ErpSyncConnectorEntity | erpSyncConnectorEntity | The ErpSyncConnectorEntity that is saved. |
Returns
Type | Description |
---|---|
ErpSyncConnectorEntity | New or updated ErpSyncConnectorEntity |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (ErpSyncAgent agent = new ErpSyncAgent())
{
// call methods on agent here...
}
}
SupportsAdvancedSearch(Int32, ErpActorType)
Indicates if the connection supports advanced search for the given erp actor
Declaration
public bool SupportsAdvancedSearch(int erpConnectionId, ErpActorType erpActorType)
Parameters
Type | Name | Description |
---|---|---|
Int32 | erpConnectionId | Ths id of the connection |
ErpActorType | erpActorType | The erp actor type to check for |
Returns
Type | Description |
---|---|
Boolean | True if advanced search is supported |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (ErpSyncAgent agent = new ErpSyncAgent())
{
// call methods on agent here...
}
}
SyncAll()
Sync all active connections
Declaration
public PluginResponse SyncAll()
Returns
Type | Description |
---|---|
PluginResponse | The response |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (ErpSyncAgent agent = new ErpSyncAgent())
{
// call methods on agent here...
}
}
TestConnectionByConfig(Int32, StringDictionary)
Tests to see if the given connection has a valid connection to its connector
Declaration
public bool TestConnectionByConfig(int erpConnectionId, StringDictionary configFields)
Parameters
Type | Name | Description |
---|---|---|
Int32 | erpConnectionId | The id of the connector we try to connect to |
StringDictionary | configFields | The config fields used to test connection |
Returns
Type | Description |
---|---|
Boolean | Returns true if success |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (ErpSyncAgent agent = new ErpSyncAgent())
{
// call methods on agent here...
}
}
TestConnectionById(Int32)
Tests to see if we can establish a connection with the given config fields
Declaration
public bool TestConnectionById(int erpConnectionId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | erpConnectionId | The id of the connection |
Returns
Type | Description |
---|---|
Boolean | Returns true if success |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (ErpSyncAgent agent = new ErpSyncAgent())
{
// call methods on agent here...
}
}
TestConnectorUrl(String)
Test if connector urls anwers
Declaration
public ErpSyncResponseCode TestConnectorUrl(string url)
Parameters
Type | Name | Description |
---|---|---|
String | url | The url to test connection on |
Returns
Type | Description |
---|---|
ErpSyncResponseCode | Enum response says ok or what is wrong |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (ErpSyncAgent agent = new ErpSyncAgent())
{
// call methods on agent here...
}
}
ToggleErpConnectionActive(Int32)
Toggles the Active state of the connection
Declaration
public string[] ToggleErpConnectionActive(int erpConnectionId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | erpConnectionId | Primary key of the erp connection |
Returns
Type | Description |
---|---|
String[] | Contains the reason for why the toggle failed. Empty if operation was successful |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (ErpSyncAgent agent = new ErpSyncAgent())
{
// call methods on agent here...
}
}
TryConnectActor(Int32, Int32, CrmActorType, String, ErpActorType, ErpSyncFieldValue[])
Create a link between Erp and Crm and set default values
Declaration
public bool TryConnectActor(int erpConnectionId, int crmRecordId, CrmActorType crmActorType, string erpKey, ErpActorType erpActorType, ErpSyncFieldValue[] fieldValues)
Parameters
Type | Name | Description |
---|---|---|
Int32 | erpConnectionId | ErpConnectionId |
Int32 | crmRecordId | CrmRecordId |
CrmActorType | crmActorType | The Crm Actor type |
String | erpKey | |
ErpActorType | erpActorType | The Erp Actor type |
ErpSyncFieldValue[] | fieldValues | The Crm Fields |
Returns
Type | Description |
---|---|
Boolean |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (ErpSyncAgent agent = new ErpSyncAgent())
{
// call methods on agent here...
}
}
UpdateConnectionFields(Int32)
Gets all supported actor types, and all fields for each actor type, and save this state to the CRM database
Declaration
public bool UpdateConnectionFields(int erpConnectionId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | erpConnectionId | The ERP connection ID |
Returns
Type | Description |
---|---|
Boolean | Success or fail |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (ErpSyncAgent agent = new ErpSyncAgent())
{
// call methods on agent here...
}
}
ValidateArchiveColumnConfig(String, Int32)
Clear field info from table SUPERLISTCOLUMNSIZE if field mapping changed on given connection
Declaration
public void ValidateArchiveColumnConfig(string listOwner, int erpConnectionId)
Parameters
Type | Name | Description |
---|---|---|
String | listOwner | GUI name used in archive control config |
Int32 | erpConnectionId | The ERP connection ID |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (ErpSyncAgent agent = new ErpSyncAgent())
{
// call methods on agent here...
}
}