308 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);
}
}
}

 

Partner Landscape: Microsoft Dynamics CRM

Learn more about the opportunities for being a partner with Microsoft Dynamics CRM.

Microsoft Dynamics CRM Online 2015 Update 1 - Service New Features

Keeping on top of your Pipeline - Microsoft Dynamics CRM 2011

This video provides an overview of how to automatically send an email reminder every time an open opportunity goes 14 or more days without being updated or modified. This is a best practice for sales teams and management that want to make sure they are on top of their pipeline.

Microsoft Dynamics CRM Online 2015 Update 1 - Folder Based Email Tracking New Features

Invoice Management : Fields on the Invoice Form

  • Summary
    • Invoice ID: The identifying number or code of the invoice.
    • Name: A descriptive name for the invoice.
      Currency: The local currency for the record. This makes sure that budgets are reported in the correct currency.
    • Price List: The price list associated with this record. This makes sure that the products associated with the campaign are offered at the correct prices.
    • Prices Locked: Status of prices specified on the invoice. They may be locked from any further updates or unlocked.
  • Shipping Dates
    • Date Delivered: Date when the products included in the invoice were delivered.
    • Due Date: Date by which the invoice should be paid by the customer.

What Areas where we can write JavaScript?

We can use JavaScript to perform actions in form scripts, ribbon commands and web resources.

MS CRM Many-to-Many Relationships of the "Native" Kind : CRM 4

What's New in CRM 2011, Session 2 Intro: Sales Force Automation

Intro to the Sales Force Automation session. Includes foundation topics (teams, queues, sales literature...); working with Charts and Dashboards; working with Goal Metrics and Goals.

Microsoft Dynamics CRM 2011: Implementing Claims and IFD: Part 5

This session will cover the setup of claims with an un-trusted domain.

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.
 

 

Color Grid for Dynamics 365

Color Form for Dynamics 365