web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Dynamics 365 Community / Blogs / Nishant Rana’s Weblog / Microsoft Dynamics CRM 3.0 ...

Microsoft Dynamics CRM 3.0 and Microsoft Dynamics CRM 4.0 differences

Nishant Rana Profile Picture Nishant Rana 11,325 Microsoft Employee
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)


This was originally posted here.

Comments

*This post is locked for comments