Microsoft Dynamics CRM 2011 Online Integration Getting Started (Early Bound)

This is a follow up to my previous post Microsoft Dynamics CRM 2011 Online Integration Getting Started (Late Bound). Here I list the steps that I had to do different to work with early binding.

After creating the project, I ran CrmSvcUtil.exe:

<location of sdk>\bin\CrmSvcUtil.exe /url:https://xxx.api.crm4.dynamics.com/XRMServices/2011/Organization.svc /out:”C:\Users\henols02\Documents\Visual Studio 2010\Projects\<project name>\Models\CrmModel.cs” /namespace:<project name>.Models /serviceContextName:CrmServiceContext /username:”<Windows Live ID” /password:”<password>”

and added the resulting CrmModel.cs to the project in the Models folder.

After creating the service proxy (in LogOn method), early bound support had to be added using the following statement:

serviceProxy.ServiceConfiguration.CurrentServiceEndpoint.Behaviors.Add(new Microsoft.Xrm.Sdk.Client.ProxyTypesBehavior());

In the created controller, getting the context and retrieving the data is done in a slightly different (simpler) way:

var context = new Elevregister1.Models.CrmServiceContext(service);
var elever = context.elev_elevSet.ToList();

I created the view as a strongly-type view:

image

Then, I removed the unwanted columns.

Advertisements

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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