Server side CRM Connection API 

pavliks.PortalConnector.Crm.Connection Namespace

The pavliks.PortalConnector.Crm.Connection namespace contains classes that provide connection functionality to the other Portal Connector namespaces.

Classes

Class Name

Description

CrmConnectionManager

The CrmConnectionManager class manages the connection to an instance of Microsoft Dynamics CRM.

CrmDirectConnection

The DirectConnection class provides a connection to the server using a connection string.

CrmEmptyConnection

The EmptyConnection class is used to return an empty connection object in case of unsuccessful connection attempts.

CrmServiceConnection

The ServiceConnection class provides a connection to the server using Microsoft Dynamics CRM web services.

Interfaces

Name

Description

ICrmConnection

Defines high-level classes, properties, and methods for server connections.

Enumerations

Name

Description

CrmConnectionType

The CrmConnectionType enumeration contains values that are used to specify the type of connection is established.

DynamicsCrmVersion

The DynamicsCrmVersion enumeration contains values that are used to specify the version information for the server.

CrmConnectionManager Class

C# Syntax

public class CrmConnectionManager : IDisposable

Classes

Name

Description

Connection

Gets the connection instance


Properties

Name

Description

CrmVersion

Gets the version of the Dynamics CRM server from the current connection.


Methods

Name

Description

Dispose()

Releases the connection object. (Inherited from IDisposable.)


CrmDirectConnection Class

C# Syntax

public sealed class CrmDirectConnection : ICrmConnection

Properties

Name

Description

ConnectionType

Gets the connection type of the current connection

Manager

Gets the connection instance of CrmConnectionManager

Valid

Gets the status of the current connection


Methods

Name

Description

CloseConnection()

Closes the connection

Connect(String)

Connects to CRM server using connection string

Create(Entity)

Creates new entity record from properties of an entity instance passed as a parameter. Returns Guid of the new record.

CreateQuery(String)

Creates a web service LINQ query for an entity specified in the parameter. Returns List representation of the query.

Delete(String, Guid)

Deletes a record from an entity specified in the logical name parameter by the record id passed as a second parameter.

Dispose()

Releases the connection object. (Inherited from IDisposable.)

Dispose(Boolean)

Checks if connection is open and the passed parameter is set to true (to dispose) then closes connection. Returns true if connection has been disposed.

Execute(OrganizationRequest)

Executes a message in the form of a request, and returns a response returned from processing the organization request.

Retrieve(String, Guid, ColumnSet)

Retrieves a set of columns, or attributes specified in the ColumnSet parameter from an entity specified in the EntityName string parameter by the record id parameter.

RetrieveEntity (String, EntityFilters, Boolean)

Retrieves entity metadata specified in the Entity Filters parameter for an entity specified in the logical name parameter.

RetrieveMultiple(QueryBase)

Retrieves an EntityCollection collection of records determined by the query parameter.

Update(Entity)

Updates an existing record based on the passed entity instance that has one or more properties set to be updated in the record.



CrmEmptyConnection Class

C# Syntax

public sealed class CrmEmptyConnection : ICrmConnection

Properties

Name

Description

ConnectionType

Gets the connection type of the current connection

Error

Gets the connection error

Manager

Gets the connection instance of CrmConnectionManager

Valid

Gets the status of the current connection


Methods

Name

Description

CloseConnection()

Closes the connection

Connect(String)

Connects to CRM server using connection string

Create(Entity)

Creates new entity record from properties of an entity instance passed as a parameter. Returns Guid of the new record.

CreateQuery(String)

Creates a web service LINQ query for an entity specified in the parameter. Returns List representation of the query.

Delete(String, Guid)

Deletes a record from an entity specified in the logical name parameter by the record id passed as a second parameter.

Dispose()

Releases the connection object. (Inherited from IDisposable.)

Dispose(Boolean)

Checks if connection is open and the passed parameter is set to true (to dispose) then closes connection. Returns true if connection has been disposed.

Execute(OrganizationRequest)

Executes a message in the form of a request, and returns a response returned from processing the organization request.

Retrieve(String, Guid, ColumnSet)

Retrieves a set of columns, or attributes specified in the ColumnSet parameter from an entity specified in the EntityName string parameter by the record id parameter.

RetrieveEntity (String, EntityFilters, Boolean)

Retrieves entity metadata specified in the Entity Filters parameter for an entity specified in the logical name parameter.

RetrieveMultiple(QueryBase)

Retrieves an EntityCollection collection of records determined by the query parameter.

Update(Entity)

Updates an existing record based on the passed entity instance that has one or more properties set to be updated in the record.



CrmServiceConnection Class

C# Syntax

public sealed class CrmServiceConnection : ICrmConnection

Properties

Name

Description

ConnectionType

Gets the connection type of the current connection

Manager

Gets the connection instance of CrmConnectionManager

Valid

Gets the status of the current connection


Methods

Name

Description

CloseConnection()

Closes the connection

Connect(String)

Connects to CRM server using connection string

Create(Entity)

Creates new entity record from properties of an entity instance passed as a parameter. Returns Guid of the new record.

CreateQuery(String)

Creates a web service LINQ query for an entity specified in the parameter. Returns List representation of the query.

Delete(String, Guid)

Deletes a record from an entity specified in the logical name parameter by the record id passed as a second parameter.

Dispose()

Releases the connection object. (Inherited from IDisposable.)

Dispose(Boolean)

Checks if connection is open and the passed parameter is set to true (to dispose) then closes connection. Returns true if connection has been disposed.

Execute(OrganizationRequest)

Executes a message in the form of a request, and returns a response returned from processing the organization request.

Retrieve(String, Guid, ColumnSet)

Retrieves a set of columns, or attributes specified in the ColumnSet parameter from an entity specified in the EntityName string parameter by the record id parameter.

RetrieveEntity (String, EntityFilters, Boolean)

Retrieves entity metadata specified in the Entity Filters parameter for an entity specified in the logical name parameter.

RetrieveMultiple(QueryBase)

Retrieves an EntityCollection collection of records determined by the query parameter.

Update(Entity)

Updates an existing record based on the passed entity instance that has one or more properties set to be updated in the record.


ICrmConnection Interface

Defines high-level classes, properties, and methods for server connections. 

C# Syntax

public interface ICrmConnection : ICrmService, IDisposable

Classes

Name

Description

Manager

Gets the connection instance of CrmConnectionManager


Properties

Name

Description

ConnectionType

Gets the type of the connection

Valid

Gets the current status of the connection


Methods

Name

Description

Dispose

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. (Inherited from IDisposable.)



CrmConnectionType Enumeration

The CrmConnectionType enumeration contains values that are used to specify the type of connection is established. 

C# Syntax

public enum CrmConnectionType

Members

Member Name

Description

DirectConnection

Represents the DirectConnection class.

ServiceConnection

Represnts the ServiceConnection class.

EmptyConnection

Represents the EmptyConnection class.


DynamicsCrmVersion Enumeration

The DynamicsCrmVersion enumeration contains values that are used to specify the version information for the server.

C# Syntax

public enum DynamicsCrmVersion

Members

Member Name

Description

DynamicsCrm4

Microsoft Dynamics CRM 4.0.0

DynamicsCrm2011

Microsoft Dynamics CRM 2011

DynamicsCrm2013

Microsoft Dynamics CRM 2013

DynamicsCrm2015

Microsoft Dynamics CRM 2015