Using Create Method of CrmService WebService

Posted: January 20, 2009 in Microsoft .NET, Microsoft Dynamics CRM
Tags: ,

// Set up the CRM Service.

CrmAuthenticationToken token = new


// You can use enums.cs from the SDK\Helpers folder to get

the enumeration for AD Authentication.

token.AuthenticationType = 0;

token.OrganizationName =”AdventureWorksCycle”;

CrmService service = new CrmService();




service.CrmAuthenticationTokenValue = token;

service.Credentials =


// Create the column set object that indicates the

properties to be retrieved.

ColumnSet cols = new ColumnSet();

// Set the properties of the column set.

cols.Attributes = new string [] {“fullname”};

// contactGuid is the GUID of the record being retrieved.

Guid contactGuid = new Guid(“4D507FFE-ED25-447B-80DE-


// Retrieve the contact.

// The EntityName indicates the EntityType of the object

being retrieved.

contact contact =


contactGuid, cols);



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s