Microsoft Dynamics CRM 3.0 and Microsoft Dynamics CRM 4.0 differences


Multiple organizations can now be hosted and WSDL APIs are now unique per organization.

 

The metadata API service has been extended to retrieve language information.

 

Plug-ins (callouts) and workflow now use the same event framework, allowing for even more extensibility.

 

The SDK has been expanded to include offline access.

 

Now we can programmatically create, read, update and delete the metadata such as entities, attributes and relationship.

 

There are three services instead of two which we used to have in previous version

 

CrmService – http://<crmserver>/mscrmservices/2007/crmservice.asmx

MetadataService – http://<crmserver>/mscrmservices/2007/metadataservice.asmx

DiscoveryService – http://<crmserver>/mscrmservices/2007/ad/crmdiscoveryservice.asmx

 

Previously to write callout we had to reference the follwing assembly

 

Microsoft.Crm.Platform.Callout.Base.dll

 

Instead now we have to reference these assemblies

 

  • Micorsoft.Crm.Sdk.dll
  • Micorsoft.Crm.SdkTypeProxy.dll
  • Micorsoft.Crm.Outlook.Sdk.dll

 

 

Now we can to settings and can then select customizations there we have the option of

Download Web Service Description File.

 

There we can find wsdl files for both CrmService and MetadataService which we can download to our machine and can the simply add web reference to them.

 

 

Previously to access and use the CrmService following lines of code were enough

 

CrmService service=new CrmService();

service.Url=// url for the CrmService

service.Credentials=System.Net.CredentialCache.DefaultCredentials;

 

But now because of the multiple organization support we need to write the following lines of code to identify the organization for which we are writing our custom solution.

 

CrmAuthenticationToken token = new CrmAuthenticationToken();

token.AuthenticationType = 0;

            // 0- Active Directory

            // 1- Microsoft Dynamics CRM Live

            // 2- Internet-Facing deployment (IFD)

token.OrganizationName=“”;// name of the organization

 

CrmService service=new CrmService();

service .Url=// url for the CrmService            service.Credentials=System.Net.CredentialCache.DefaultCredentials;

service.CrmAuthenticationTokenValue = token;

 

 

We have to access the Metadataservice in the similar manner i.e. creating CrmAuthenticationToken and assigning it to CrmMetadataService’s CrmAuthenticationTokenValue.

 

In 3.0 version we could use Metadataservice to access metadata information about any specific entity however in the new version following things are possible

 

  • Creating a customentity.
  • Add or update an attribute for an entity.
  • Create or delete a relationship between two entities.
  • Add or remove an option from a picklist attribute and few others.

 

 

  // CrmDiscoveryService Web service can provide a list of organizations and their corresponding Web service

 // endpoints URL’s. We will use it to configure the CrmService and MetadataService Web service proxies.

           

  CrmDiscoveryService discService = new CrmDiscoveryService();

  discService.UseDefaultCredentials = true;

  discService.Url = http://localhost/MSCRMServices/2007/AD/CrmDiscoveryService.asmx&#8221;;

 

  // Retrieve the list of organization

RetrieveOrganizationsRequest orgRequest = new    RetrieveOrganizationsRequest();

RetrieveOrganizationsResponse orgResponse =(RetrieveOrganizationsResponse) discService.Execute(orgRequest);

 

// Loop through the list to locate the target organization

 

OrganizationDetail orgInfo = null;

foreach (OrganizationDetail orgDetail in orgResponse.OrganizationDetails)

{

if (orgDetail.OrganizationName == “OurOrganizationName”)

    {

          orgInfo = orgDetail;

          break;

    }

}

 

After obtaining the organization details, we can then access the CrmService and MetadataService Web Services to perform our business logic.

 

 

References :

Working with Microsoft Dynamics CRM 4.0 (Microsoft Press)


Discover more from Nishant Rana's Weblog

Subscribe to get the latest posts sent to your email.

Unknown's avatar

Author: Nishant Rana

I love working in and sharing everything about Microsoft.NET technology !

Please share your thoughts

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from Nishant Rana's Weblog

Subscribe now to keep reading and get access to the full archive.

Continue reading

Power Platform Puzzles

D365 CRM, Power Platform Tips &Tricks

Power Spark

Power Spark By Shrangarika

Van Carl Nguyen

Exploration of Power Platform

My Trial

It is my experience timeline.

Power⚡Thomas

Sharing my knowledge and experience about the Microsoft Power Platform.

Arpit Power Guide

a guide to powering up community

Welcome to the Blog of Paul Andrew

Sponsored by Cloud Formations Ltd

Deriving Dynamics 365

Deriving Solutions and features on Power Platform/Dynamics 365

The CRM Ninja

Thoughts & musings from a Microsoft Business Applications Ninja!

D CRM Explorer

Learn about Microsoft Dynamics CRM Power Platform customization and implementation and other cool stuffs

Stroke // Jonas Rapp

I know pre-stroke. I will improve who I was.

Power Melange

Power Melange By Shalinee

Clavin's Blog - PPUG.ORG

AI - Power Automate - Power Apps - SharePoint Online - Azure - Nintex - K2 - Artificial Intelligence

Sat Sangha Salon

An Inquiry in Being

The Indoencers

The Influencers & Influences of Indian Music

Monika Halan's blog

Hand's-free money management

D365 Demystified

A closer look at Microsoft Dynamics 365.

Microsoft Mate (msftmate) - Andrew Rogers

Experienced consultant primarily focused on Microsoft Dynamics 365 and the Power Platform

Manmit Rahevar's Blog

One Stop Destination for Microsoft Technology Solutions

MG

Naturally Curious

Brian Illand

Power Platform and Dynamics 365

Steve Mordue

The Professional Paraphraser

Subwoofer 101

Bass defines your home theater

SQLTwins by Nakul Vachhrajani

SQL Server tips and experiences dedicated to my twin daughters.

Everything D365

Discovering Azure DevOps and D365 Business Applications

Tech Wizard

Lets do IT Spells

XRM Tricks (Power Platform & Dynamics CRM )

Power Platform & Dynamics CRM

CRM TIPS BY PRM

Mail to crmtipsbyprm@gmail.com for queries and suggestions

nijos.dev

Giving back to the community what I have learned

Power Platform Learning

Your Go-To Resource for Power Apps, Power Automate & More

xrm CRM Dynamics

Dynamics CRM Technical & Functional Info

Dynamics 365 Blogs - Explained in unique way

Sometimes you need to look at things from different perspective.