Interface IErpSyncAgent
Interface for the ErpSync Agent Services for the ERP Integration Services feature
Online Restricted: This agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.Namespace: SuperOffice.CRM.Services
Assembly: SuperOffice.Services.dll
Syntax
[Agent("ErpSync Agent", "Interface for the ErpSync Agent. Services for the ERP Integration Services feature")]
public interface IErpSyncAgent : IAgent
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (ErpSyncAgent agent = new ErpSyncAgent())
{
// call methods on agent here...
}
}
Methods
BreakActorLink(Int32, Int32, CrmActorType)
Remove the link between a CRM entity and an ERP entity
Online Restricted: The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.Declaration
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?
Online Restricted: The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.Declaration
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
Online Restricted: The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.Declaration
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
Online Restricted: The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.Declaration
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
Online Restricted: The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.Declaration
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
Online Restricted: The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.Declaration
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
Online Restricted: The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.Declaration
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
Online Restricted: The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.Declaration
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.
Online Restricted: The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.Declaration
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
Online Restricted: The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.Declaration
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
Online Restricted: The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.Declaration
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
Online Restricted: The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.Declaration
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
Online Restricted: The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.Declaration
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.
Online Restricted: The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.Declaration
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.
Online Restricted: The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.Declaration
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
Online Restricted: The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.Declaration
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
Online Restricted: The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.Declaration
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
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
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
Online Restricted: The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.Declaration
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.
Online Restricted: The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.Declaration
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.
Online Restricted: The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.Declaration
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
Online Restricted: The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.Declaration
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
Online Restricted: The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.Declaration
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
Online Restricted: The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.Declaration
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
Online Restricted: The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.Declaration
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.
Online Restricted: The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.Declaration
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
Online Restricted: The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.Declaration
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
Online Restricted: The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.Declaration
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.
Online Restricted: The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.Declaration
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
Online Restricted: The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.Declaration
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
Online Restricted: The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.Declaration
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
Online Restricted: The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.Declaration
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
Online Restricted: The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.Declaration
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
Online Restricted: The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.Declaration
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.
Online Restricted: The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.Declaration
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.
Online Restricted: The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.Declaration
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
Online Restricted: The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.Declaration
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
Online Restricted: The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.Declaration
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
Online Restricted: The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.Declaration
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
Online Restricted: The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.Declaration
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
Online Restricted: The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.Declaration
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
Online Restricted: The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.Declaration
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
Online Restricted: The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.Declaration
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
Online Restricted: The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.Declaration
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
Online Restricted: The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.Declaration
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
Online Restricted: The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.Declaration
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
Online Restricted: The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.Declaration
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
Online Restricted: The ErpSync agent is not available in Online by default. Access must be requested specifically when app is registered. Intended for ERP integration apps.Declaration
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...
}
}