97 Saturday, May 28, 2016 |
Msxrmtools Publisher
Publisher at Msxrmtools

Working with Connections - Microsoft Dynamics CRM

In this video we review:

  • What connections are
  • How to use connections
  • How to build custom connections

Dynamics CRM 2011 - Connected Cloud Demo.wmv

In this demonstration of a real estate scenario, you'll see how Microsoft Online Services, including Microsoft Dynamics® CRM Online, Microsoft® Office 365, and Windows Azure,® provide a connected experience that leverages the power of the cloud.
 

 

Product Catalog : Write-in Products

Write-In products are intended for products or services not currently in the product catalog.

Examples:

  • Miscellaneous charges or fees
  • Credits. To enter a credit, add a Write-In line item with a negative number in the Price Per Unit field and a value of 1 in the Quantify field.

Taking Advantage of Web Resources Dynamics CRM 2011

SLA Enhancements in Microsoft Dynamics CRM 2015

Rollup and Calculated Fields in Microsoft Dynamics CRM 2015

Delete Record In Dynamics CRM - Late Bound

Following example demonstrates how to delete record in dynamics crm using late bound.

Connection string

<connectionStrings>
<add name="connection" connectionString="Url=https://org.crm.dynamics.com; Username=user@org.onmicrosoft.com; Password=password;"/>
</connectionStrings>

 C#

using Microsoft.Xrm.Client.Services;
using Microsoft.Xrm.Sdk;
using System;

namespace CrmSampleCodes
{
class Program
{
static void Main(string[] args)
{
IOrganizationService _service = new OrganizationService("connection");

Entity contact = new Entity("contact");
contact["firstname"] = "Suresh";
contact["lastname"] = "Maurya";

Console.WriteLine("Creating Contact");

Guid contactId = _service.Create(contact);

Console.WriteLine("Contact with guid=" + contactId + " created");
Console.WriteLine();
Console.WriteLine("Deleting Contact with guid=" + contactId + " created");

_service.Delete("contact", contactId);

Console.WriteLine("Contact Deleted");
}
}
}

On Demand Workflows and Security Roles: CRM4

Organization Service Context Class in Microsoft Dynamics CRM

OrganizationServiceContext is alternative to OrganizationServiceProxy to connect to Microsoft Dynamics CRM programmatically.

OrganizationServiceContext class can be generated by the code generation tool (CrmSvcUtil.exe).

Advantages of OrganizationServiceContext

  • It lets you track changes, manage identities and relationships.
  • Allows LINQ queries against Microsoft Dynamics CRM data.
  • Tracked changes can be commited in a single request with OrganizationServiceContext.Save method.

Generate OrganizationServiceContext class

To generate this class, provide a value for the /serviceContextName parameter when you generate early bound types.

For On-premises

CrmSvcUtil.exe /url:http://<serverName>/<organizationName>/XRMServices/2011/Organization.svc    /out:<outputFilename>.cs /username:<username> /password:<password> /domain:<domainName>    /namespace:<outputNamespace> /serviceContextName:<serviceContextName>

 

For Microsoft Dynamics CRM Online

CrmSvcUtil.exe /url:https://<organizationUrlName>.api.crm.dynamics.com/XRMServices/2011/Organization.svc    /out:<outputFilename>.cs /username:<username> /password:<password>     /namespace:<outputNamespace> /serviceContextName:<serviceContextName>

Using OrganizationServiceContext class

To instantiate the context class, you must pass the class constructor an object that implements the IOrganizationService interface.

With OrganizationService

//connection is the connection string name in config file
IOrganizationService _service = new OrganizationService("connection"); AdventureWorksCycleServiceContext context = new AdventureWorksCycleServiceContext(_service);

With OrganizationServiceProxy

//For early bound types to work correctly, they have to be enabled on the proxy.
_serviceProxy.EnableProxyTypes();
AdventureWorksCycleServiceContext context = new AdventureWorksCycleServiceContext(_serviceProxy);

After you create the organization service context object, you can begin to track create, modify, or delete entities. For example, the following code example shows how to instantiate a new contact, and then save it to a Microsoft Dynamics CRM server by using the service context object.

//  Create a new contact record;
AdventureWorksCycleServiceContext context = new AdventureWorksCycleServiceContext (_serviceProxy);
Contact contact = new Contact() 
 {
   FirstName = "Pamela",
   LastName = "Brown",
   Address1_Line1 = "123 Easy St.",
   Address1_City = "Atlanta",
   Address1_StateOrProvince = "GA",
   Address1_PostalCode = "32254",
   Telephone1 = "425-555-5678"   };
context.AddObject(contact);
context.SaveChanges();

 

 

Microsoft Dynamics CRM 2011 - Getting online through product and programs

Microsoft Dynamics CRM 2013 Application and User Interface New Features

Color Grid for Dynamics 365

Color Form for Dynamics 365