85 Saturday, May 21, 2016 |
Suresh Maurya
Dynamics CRM Consultant at IBM

Update Record In Microsoft Dynamics CRM Using Early Bound

Update Method

To update record use IOrganizationService.Update(entitymethod.

Parameters

Name Type Comment
entity Microsoft.Xrm.Sdk.Entity Entity object to update

Output

Void

This method is implemented by OrganizationService class and OrganizationServiceContext generated in previous chapter.

Using Early Bound

To update object assign updated values to the fields of object.

//retrieve account to update
Account account = (Account)_service.Retrieve(Account.EntityLogicalName, _accountId, new ColumnSet(true));

//update the values
account.Name = "Update Name";
account.Revenue = new Money(500000);

You can get the object to update multiple ways for ex: using retrieve operation.

Object to update must have Guid in the Id field, when we retrieve object it is already present.

Now pass prepared object to the Update method.

 //pass object to update method
_service.Update(account);

 

Following example demonstarates how to update record in Microsoft Dynamics CRM using early bound

C#

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

namespace Msxrmtools
{
class Program
{
static void Main(string[] args)
{
//"connection" = connection string name from config file"
IOrganizationService _service = new OrganizationService("connection");

//assumed guid of existing account record
Guid _accountId = new Guid("9ec0b0ec-d6c3-4b8d-bd75-435723b49f84");

//retrieve account to update
Account account = (Account)_service.Retrieve(Account.EntityLogicalName, _accountId, new ColumnSet(true));

//update the values
account.Name = "Update Name";
account.Revenue = new Money(500000);

//pass object to update method
_service.Update(account);
}
}
}

 

Dynamics CRM 2011: Sales Force Automation

Microsoft Dynamics CRM for the Financial Advisor

Dynamics CRM 2011 - Optimize Customer Experience

Demonstration of how Microsoft Dynamics CRM 2011 can be used to optimize customer experience.

Disassociate Records in Dynamics CRM - Late Bound

Following example demonstrates how to disassociate record in dynamics crm

public static void DisassociateContactsToAccount(EntityReference contact, EntityReference account, IOrganizationService service) {

// Creating EntityReferenceCollection for the Contact
EntityReferenceCollection relatedEntities = new EntityReferenceCollection();

// Add the related entity contact
relatedEntities.Add(contact);

// Add the Account Contact relationship schema name
Relationship relationship = new Relationship("contact_customer_accounts");

// Disassociate the contact record to Account
service.Disassociate(account.LogicalName, account.Id, relationship, relatedEntities);

}

harePoint 2010 and CRM 2011 Integration - List Component and Contextual Search

It's about two ways of integrating CRM and SharePoint:

  1.  using the CRM 2011 List Component for SharePoint 2010 to get automatic library and folder creation in SP from CRM; and
  2.  Contextual search of SharePoint from CRM records, using JScript and an IFrame.

Ad-hoc Reporting for Microsoft Dynamics AX, NAV, GP, SL and CRM

In this video, you will learn how easy it is to query and report on your Microsoft Dynamics AX, NAV, GP, SL and CRM ERP database with BI360's ad-hoc reporting tool.
 

 

Microsoft Dynamics CRM Online - Mail Merge

This video will guide you through creating mail merge documents from Microsoft Dynamics CRM Online. First we create a mail merge template. Then we walk through how to create a Quick Campaign Email using mail merge. Finally, we show how to create mailing lables using mail merge.

Web API in Microsoft Dynamics CRM

Web API is introduced with Microsoft Dynamics CRM 2016 and will provide parity with the Organization service.

Key points about Web API:

  • Web API provides parity with Organization service with some limitations.
  •  It implements  OData (Open Data Protocol) version 4.0 which is an open standard for building and consuming RESTful APIs over rich data sources like DOC, HTML and PDF.
  • Because Web API is built on open standards therefore it's no necessary to use Microsoft Dynamics CRM provided libraries, third-party libraries can be used to generate classes. 
  • You can compose own Http requests as well. 
  • Wep API supports wide variety of programming languages (including .Net, C++, Java, JavaScript, Python), platforms and devices as compared to Organization service.
  • Web API will gradually replace Organization service and Organization Data service to become single web service for Microsoft Dynamics CRM.
  • Wep API Request and Response have JSON format, so its very easy to work with Wep API from JavaScript.
  • Authentication is provided by the application itself when used within web resources, form scripts and ribbon commands. 
  • Maximum 5000 records can be return for each request.

Web API Authentication 

Web API authentication with JavaScript

Authentication to Web API in JavaScript is provided by the application itself when used within

  • HTML web resources
  • Form Scripts
  • Ribbon Commands

you don't need to write code for that.

In each of these cases user is already authenticated and authentication is managed by the application.

 

Dynamics CRM 2011 : Teams, Queues, Sales Literature

How to rename button in CRM 2011?

  1. Create a solution add the entity what you want and export it and extract it xml designer.
  2. Then navigate into the location RibbonDiffXml next add the customaction tag by specifying id and location and sequence.
  3. Next add button by specifying the id, command, sequence, Alt, label text, image 16 and 32, templatealias, tooltip title and description under the tag CommandUIDefinition>
  4. Next define the template with lable, tooltip text, description.