MSCRM Solution Come, Learn and Share

By: Amit Choudhary | October 30, 2015

In high transaction CRM system, it is often possible that two users are working on same record and updating record at the same time. This might result in data loss. For example, you opened a contact record and trying to update Mobile number for that contact. At the same time, another user opened record and trying to update Last Name. Suppose they both clicked the save button at almost same time. What will happen? The update request which reaches later will be the end result of data. So the first update request will get lost. 


To avoid these kind of scenarios Microsoft introduced Optimistic Concurrency with CRM 2015 Online Update 1. This feature is not yet available for CRM on premise.


How to enable Concurrency Behavior for Entities:

Concurrency version is enabled by default for all custom entities. For Out of the box entities, you can use IsOptimisticConcurrencyEnabled method to check if an entity is supporting this behavior.


How to use Concurrency Behavior Programatically:

As of now the only way to enable concurrency is by SDK call. There is no way to configure Concurrency Behavior through UI. Below is the sample code to enable concurrency behavior:


// Retrieve a contact record using Retrieve method
    var contact = _serviceProxy.Retrieve("contact", contactid, new ColumnSet("firstname","lastname"));


    //Determine the retrieved row version of contact
    Console.WriteLine("After Retrieveing Row Version of Contact:" + contact.RowVersion);


    if (contact != null)
    {
        // Create an Entity object
        Entity newContact = new Entity()
        {
            LogicalName = contact.LogicalName,
            Id = contact.Id,
            RowVersion = contact.RowVersion
        };


        // Update the Contact income.
        newContact["new_income"] = new Money(1000000);


        // Set the concurrency behavior to check for a row version match. If row version does not match
        //It will throw exception otherwise contact record will gets updated.
        UpdateRequest contactReq = new UpdateRequest()
        {
            Target = newContact,
            ConcurrencyBehavior = ConcurrencyBehavior.IfRowVersionMatches
        };


        // Perform the update operation.
        UpdateResponse accountUpdateResponse = (UpdateResponse) _serviceProxy.Execute(contactReq);
       
        }


If we walk through the above code, we retrieved the contact record. After retrieving the contact record, we retrieved the RowVersion property of the retrieved contact record. Then, we created a new Contact object to update the income of the contact. While creating that new object, set the RowVersion property equals to RowVersion of retrieved contact. If you notice highlighted line in the code, we are setting Concurrency Behavior as IfRowVersionMatches.

When this request reaches to server, it checks for RowVersion property of Update Request and current RowVersion property of the record. If the RowVersion matches, it will update the record else an exception will be thrown and update request will not be performed.

Comments:

Office.Com/Myaccount

Posted on : February 11, 2019

[url=https://www-office-com-setup.net/]Www.Office.Com/Setup, Office.Com/Setup[/url] - If you use a Microsoft Office service like Outlook, OneDrive, Xbox Live, or Skype, you already have an account. Sign in Create a new account Already entered a product key Www.Office.Com/Myaccount and looking for your software.<br/><br/><br/><br/>[url=https://sites.google.com/view/officeactivation/home]Www.Office.Com/ Setup<br/><br/>[/url]


Office.Com/Myaccount | Office.Com/ Setup | Www Office Com Setup

Posted on : February 11, 2019

<a href="https://www-office-com-setup.net/"><strong>Www.Office.Com/Setup, Office.Com/Setup</strong></a> - If you use a Microsoft Office service like Outlook, OneDrive, Xbox Live, or Skype, you already have an account. Sign in Create a new account Already entered a product key Www.Office.Com/Myaccount and looking for your software.<br/><br/><a href="https://sites.google.com/view/officeactivation/home"><strong>Www.Office.Com/ Setup</strong></a><br/><br/>


markant

Posted on : December 07, 2018

<a href="https://www.kinemasterforpcdownload.co/">KineMaster apk</a>
<br />
<a
href="https://www.kinemasterforpcdownload.co/2018/12/kinemaster-for-pc-windows.html">KineMaster
for PC</a>
<br />
<a
href="https://www.kinemasterforpcdownload.co/2018/12/kinemaster-apk-download.html">KineMaster
APK Download</a>
<br />
<a
href="https://www.kinemasterforpcdownload.co/2018/12/kinemaster-for-mac-free-download.html">KineMaster
for Mac</a>
<br />
<a
href="https://www.kinemasterforpcdownload.co/2018/12/kinemaster-for-android-free-download.html">KineMaster
for android</a>
<br />
<a
href="https://www.kinemasterforpcdownload.co/2018/12/kinemaster-for-ios-free-download.html">KineMaster
for iOS</a>
<br />
<a
href="https://www.kinemasterforpcdownload.co/2018/12/kinemaster-pro-for-pc-windows.html">KineMaster
pro for PC</a>
<br />
<a
href="https://www.kinemasterforpcdownload.co/2018/12/kinemaster-pro-apk-free-download.html">KineMaster
pro apk</a>
<br />
<a href="https://www.freefirepcdownload.online/">Free fire apk</a>
<br />
<a
href="https://www.freefirepcdownload.online/2018/12/free-fire-for-pc-windows.html">Free
fire for PC</a>
<br />
<a
href="https://www.freefirepcdownload.online/2018/12/free-fire-apk-download.html">Free
fire apk Download</a>
<br />
<a
href="https://www.freefirepcdownload.online/2018/12/free-fire-for-mac.html">Free
fire for mac</a>
<br />
<a
href="https://www.freefirepcdownload.online/2018/12/free-fire-for-ios.html">Free
fire for ios</a>
<br />
<a
href="https://www.freefirepcdownload.online/2018/12/free-fire-for-windows-phone.html">Free
fire for windows phone</a>
<br />
dvkfnvlf


James Shelton

Posted on : November 17, 2018

<a href="http://greenfarm3mod.xyz/apk/">http://greenfarm3mod.xyz/apk/</a>
<br />
<a href="http://bullyanniversaryeditionmod.xyz/apk/">http://bullyanniversaryeditionmod.xyz/apk/</a>
<br />
<a href="https://beachbuggyracingmod.xyz/apk/">https://beachbuggyracingmod.xyz/apk/</a>
<br />


Tan Loo Mei

Posted on : November 10, 2018

saya sedikit takut. Saya butuh waktu untuk berpikir.ini ke 18<br />
<a href="http://www.besibaja.id/pusat-plat-stainless-ss316.html">pusat
plat stainless ss316</a>
<br />
<a href="http://www.besibaja.id/pusat-plat-sumihard.html">pusat plat sumihard</a>
<br />
<a
href="http://www.besibaja.id/pusat-round-bar-besi-aisi-440s45c.html">pusat
round bar besi aisi 440s45c</a>
<br />
<a href="http://www.besibaja.id/pusat-round-bar-scm440.html">pusat round
bar scm440</a>
<br />
<a href="http://www.besibaja.id/pusat-steel-rail.html">pusat steel rail</a>
<br />
<a href="http://www.besibaja.id/pusat-steel-sheet-pile.html">pusat steel
sheet pile</a>
<br />
<a href="http://www.besibaja.id/stockis-plat-hardox.html">stockis plat hardox</a>
<br />
<a href="http://www.besibaja.id/stockist-plat-astm-a285-c.html">stockist
plat astm a285 c</a>
<br />
<a
href="http://www.besibaja.id/stockist-plat-high-strenght.html">stockist
plat high strenght</a>
<br />
<a
href="http://www.besibaja.id/stockist-plat-stainless-ss316.html">stockist
plat stainless ss316</a>
<br />
<a href="http://www.besibaja.id/stockist-plat-sumihard.html">stockist
plat sumihard</a>
<br />
<a href="http://www.besibaja.id/supplier-plat-hardox.html">supplier plat hardox</a>
<br />
<a href="http://www.gudangbesibaja.com/category/besi-baja-siku/">Jual
besi siku</a>
<br />
<a href="https://goo.gl/XZ6zpY">undangan pernikahan yang unik</a>
<br />
<a
href="http://www.sentrabesibaja.com/welded-beam-castellated-beam-queen-king-cross-beam-t-beam/">Harga
Welded Beam T beam King Queen Cross Castellated Beam</a>
<br />
<a
href="http://ironsteelcenter.com/besi-baja-h-beam-channelh-kanalh-ss400-a36/harga-jual-besi-h-beam-baja-supplier-pabrik-besi-agen-distributor">Toko
Besi H beam Baja</a>
<br />
<a
href="http://www.gudangbesibaja.com/harga-jual-pabrik-supplier-agen-distributor-plat-bordes-kembang">Supplier
Plat Bordes</a>
<br />
<a
href="http://www.pusatbesibaja.co.id/harga-welded-beam-pabrik-agen-jual-supplier-toko-produsen-distributor">Toko
Welded Beam</a>
<br />
<a
href="http://www.pusatbesibaja.com/harga-welded-beam-toko-produsen-supplier-agen-pabrik-distributor-jual">Toko
Welded Beam</a>
<br />
<a href="http://ironsteelcenter.com">ironsteelcenter.com</a>
<br />
<a
href="http://www.gudangbesibaja.com/category/besi-baja-plat-hitam-plat-kapal/">Jual
Plat besi plat kapal</a>
<br />
<a href="http://www.undangancinta.com">undangan pernikahan amplop</a>
<br />
<a href="http://www.sentrabesibaja.com/bondek-cor-sni/">Harga Bondek Cor</a>
<br />
<a
href="http://ironsteelcenter.com/besi-baja-h-beam-channelh-kanalh-ss400-a36/harga-jual-besi-h-beam-baja-supplier-pabrik-besi-agen-distributor">Jual
Besi H beam Baja</a>
<br />
<a
href="http://www.gudangbesibaja.com/harga-jual-pabrik-supplier-agen-distributor-plat-bordes-kembang">Toko
Plat Bordes</a>
<br />
<a
href="http://www.jualbesibetonhargapabrikmurah.com/category/besi-beton-sni-ulir-polos/">harga
besi beton Sni Ulir Polos polos ulir</a>
<br />
<a
href="http://www.pusatbesibaja.co.id/harga-welded-beam-pabrik-agen-jual-supplier-toko-produsen-distributor">Agen
Welded Beam</a>
<br />
<a
href="http://www.pusatbesibaja.com/harga-welded-beam-toko-produsen-supplier-agen-pabrik-distributor-jual">Agen
Welded Beam</a>
<br />
<a
href="http://ironsteelcenter.com/category/stainless-steel-ss-sus-304-210-316-310-301-stenlis">Jual
stainless steel</a>
<br />
<a href="http://www.gudangbesibaja.com/category/besi-baja-h-beam/">Jual
besi h beam baja</a>
<br />
<a href="https://goo.gl/XZ6zpY">undangan pernikahan unik dan murah</a>
<br />
<a href="http://www.sentrabesibaja.com/atap-spandek/">Harga Atap Spandek Sni</a>
<br />
<a
href="http://ironsteelcenter.com/besi-baja-h-beam-channelh-kanalh-ss400-a36/harga-jual-besi-h-beam-baja-supplier-pabrik-besi-agen-distributor">Harga
Besi H beam Baja</a>
<br />
<a
href="http://www.gudangbesibaja.com/harga-jual-pabrik-supplier-agen-distributor-plat-bordes-kembang">Agen
Plat Bordes</a>
<br />
<a
href="http://www.jualbesibetonhargapabrikmurah.com/category/besi-beton-sii-ulir-polos/">harga
besi beton sii</a>
<br />
<a href="https://goo.gl/ncgJmF">Jual Jaket Parka</a>
<br />
<a href="https://goo.gl/ncgJmF">Jaket Parka</a>
<br />
<a href="http://www.undangancinta.com">undangan pernikahan kalender</a>
<br />
<a href="http://www.undangancinta.com">undangan pernikahan bahasa
inggris islam</a>
<br />
<a href="http://www.undangancinta.com">undangan pernikahan islami</a>
<br />
<a href="http://www.undangancinta.com">undangan pernikahan unik dan murah</a>
<br />
<a href="http://www.undangancinta.com">undangan pernikahan modern</a>
<br />
<a href="http://www.undangancinta.com">undangan pernikahan online</a>
<br />
<a href="http://www.undangancinta.com">undangan pernikahan</a>
<br />
<a href="http://www.undangancinta.com">undangan pernikahan amplop surat</a>
<br />
<a href="http://www.undangancinta.com">undangan pernikahan simple</a>
<br />
<a href="http://www.undangancinta.com">undangan pernikahan murah</a>
<br />
<a href="http://www.undangancinta.com">undangan pernikahan unik</a>
<br />
<a href="http://www.undangancinta.com">undangan pernikahan artis</a>
<br />
<a href="http://www.undangancinta.com">undangan pernikahan modern</a>
<br />
<a href="http://www.undangancinta.com">undangan pernikahan artis</a>
<br />
<a href="http://www.undangancinta.com">undangan pernikahan arab</a>
<br />
<a href="https://goo.gl/GaKHyC">undangan pernikahan</a>
<br />
<a href="http://bit.ly/1P41Awa">undangan pernikahan</a>
<br />
<a
href="http://www.pusatbesibaja.co.id/harga-besi-pipa-schedule-sch-40-supplier-agen-pabrik-toko-jual-distributor-produsen">Supplier
sch 40</a>
<br />
<a
href="http://www.pusatbesibaja.com/harga-besi-pipa-schedule-sch-40-agen-toko-supplier-distributor-produsen-jual-pabrik">Supplier
sch 40</a>
<br />
<a
href="http://ironsteelcenter.com/category/besi-baja-plat-kapal">Supplier
Plat kapal besi baja bki krakatau steel</a>
<br />
<a href="http://www.gudangbesibaja.com/category/besi-beton/">Supplier
besi beton Sni Ulir Polos</a>
<br />
<a href="https://goo.gl/XZ6zpY">undangan pernikahan ala jepang</a>
<br />
<a
href="http://www.sentrabesibaja.com/pipa-besi-baja-sch-40-schedule/">Pabrik
Besi Pipa Baja Schedule 40</a>
<br />
<a
href="http://ironsteelcenter.com/besi-unp-channel-kanal-u-master-kayafit-ks-eq-ss400-a36-stainless-stenliss-stainlis-stainles-stenlis-sus304-ss201-aisi310-316-alumunium-almunium-tembaga/harga-supplier-pabrik-jual-agen-distributor-besi-unp-baja">Toko
Besi Unp Baja</a>
<br />
<a
href="http://www.gudangbesibaja.com/harga-besi-i-wf-baja-profil-supplier-jual-agen-besi-distributor-pabrik">Supplier
besi wf</a>
<br />
<a
href="http://www.pusatbesibaja.co.id/harga-besi-pipa-schedule-sch-40-supplier-agen-pabrik-toko-jual-distributor-produsen">Toko
sch 40</a>
<br />
<a
href="http://www.pusatbesibaja.com/harga-besi-pipa-schedule-sch-40-agen-toko-supplier-distributor-produsen-jual-pabrik">Toko
sch 40</a>
<br />
<a
href="http://ironsteelcenter.com/category/besi-baja-siku-lokal-imoprt-ispat-master-ks-eq-ss400-a36-stainless-stenliss-stainlis-stainles-stenlis-sus304-ss201-aisi310-316-alumunium-almunium-tembaga-kuningan">Supplier
besi siku</a>
<br />
<a href="http://www.gudangbesibaja.com/category/besi-baja-wf/">Supplier
besi wf baja</a>
<br />
<a href="http://www.undangancinta.com">undangan pernikahan islami</a>
<br />
<a
href="http://www.sentrabesibaja.com/pipa-besi-hitam-medium-galvaniz/">Pabrik
Pipa Besi Hitam Medium</a>
<br />
<a
href="http://ironsteelcenter.com/besi-unp-channel-kanal-u-master-kayafit-ks-eq-ss400-a36-stainless-stenliss-stainlis-stainles-stenlis-sus304-ss201-aisi310-316-alumunium-almunium-tembaga/harga-supplier-pabrik-jual-agen-distributor-besi-unp-baja">Jual
Besi Unp Baja</a>
<br />
<a
href="http://www.gudangbesibaja.com/harga-besi-i-wf-baja-profil-supplier-jual-agen-besi-distributor-pabrik">Toko
besi wf</a>
<br />
<a
href="http://www.jualbesibetonhargapabrikmurah.com/category/besi-beton-sni-ulir-polos/">Distributor
besi beton Sni Ulir Polos polos ulir</a>
<br />
<a
href="http://www.pusatbesibaja.co.id/harga-besi-pipa-schedule-sch-40-supplier-agen-pabrik-toko-jual-distributor-produsen">Agen
sch 40</a>
<br />
<a
href="http://www.pusatbesibaja.com/harga-besi-pipa-schedule-sch-40-agen-toko-supplier-distributor-produsen-jual-pabrik">Agen
sch 40</a>
<br />
<a
href="http://ironsteelcenter.com/category/pipa-besi-hitam-medium-sch-schedule-40-80-a53-seamless-welded-wiremesh-wermesh-cakar-ayam-m4-m5-m6-m7-m8-m9-m10-m11-m12-ss400-a36-stainless-stenliss-stainlis-stainles-stenlis-alumunium-tembaga-sus304">Supplier
pipa besi baja sch 40 sch 80</a>
<br />
<a
href="http://www.gudangbesibaja.com/category/besi-baja-unp-kanal-u/">Supplier
besi unp</a>
<br />
<a href="http://www.undangancinta.com">undangan pernikahan ada fotonya</a>
<br />
<a href="http://www.sentrabesibaja.com/besi-baja-i-wf-profil/">Pabrik
Besi Wf</a>
<br />
<a
href="http://ironsteelcenter.com/besi-unp-channel-kanal-u-master-kayafit-ks-eq-ss400-a36-stainless-stenliss-stainlis-stainles-stenlis-sus304-ss201-aisi310-316-alumunium-almunium-tembaga/harga-supplier-pabrik-jual-agen-distributor-besi-unp-baja">Harga
Besi Unp Baja</a>
<br />
<a
href="http://www.gudangbesibaja.com/harga-besi-i-wf-baja-profil-supplier-jual-agen-besi-distributor-pabrik">Agen
besi wf</a>
<br />
<a
href="http://www.jualbesibetonhargapabrikmurah.com/category/besi-beton-sii-ulir-polos/">Distributor
besi beton sii</a>
<br />


Jennifer Abdullah

Posted on : October 23, 2018

Thanks for sharing this great content here I love this post very much <a
href="https://apkinflux.com/clash-royale-mod-apk/">clash royale mod apk</a>
<a href="https://apkgap.com/hungry-shark-evolution-mod-apk/">hungry
shark evolution mod apk</a>
<a href="https://apkhop.com/my-talking-angela-mod-apk/">my talking
angela mod apk</a>


anna

Posted on : October 15, 2018

As nice blog,but you could have made <a href="https://www.assignmenthelper.com.au/assignment-help/">https://www.assignmenthelper.com.au/assignment-help/</a>
this blog more cool but all the same you have done a good job:))


jimmy

Posted on : September 22, 2018

I had felt that checks would not be go through close to three times.
Obviously that was not the situation for the credit union. Obviously, <a
href="https://www.glamourjackets.com">leather biker jackets for men</a>
it piled on about $500 for the measure of the check in addition to the charges.<br />


USTAD

Posted on : July 16, 2018

In this case you will begin it is important, it again produces a web
site a strong significant internet site: <a
href="https://www.languageofdesires.com/7-obsession-phrases-that-makes-a-man-fall-deeply-in-love">His
Secret Obsession</a>
<br />


USTAD

Posted on : July 14, 2018

Why do only so much written on this subject? Here you see more. <a href="https://www.naturalfoodseries.com/10-benefits-pineapples">Pineapple</a>
<br />


USTAD

Posted on : July 13, 2018

This content is simply exciting and creative. I have been deciding on a
institutional move and this has helped me with one aspect. <a
href="http://www.lovetractions.com/message-of-obsession-by-karen-fox">Messages
of Obsession</a>
<br />


USTAD

Posted on : July 10, 2018

Gives you the best website address I know there alone you&#39;ll
find how easy it is. <a
href="https://www.naturalfoodseries.com/10-remedies-treat-vaginal-yeast-infection">Yeast Infection</a>
<br />


JamesSmith

Posted on : June 22, 2018

<a href="https://firestarterdownload.com/">Firestarter Download</a>
is the magic stick that let you enjoy all the Android content on your
fire TV. Firestarter app launches Android apps on Amazon Fire TV.<br />


ashly doll

Posted on : May 09, 2018

Mmm.. estimable to be here in your report or notify, whatever, I repute
I should moreover process strong for my have website want I play some
salubrious further updated busy in your location. <a href="https://www.icoranker.com">icos</a>
<br />


sggt

Posted on : February 06, 2018

watch six o&#39;clock position with an <a
href="http://www.rolexreplicauk.co.uk" title="rolex replica uk">rolex
replica uk</a>
independent small seconds, small seconds plate is <a
href="http://www.juliatoms.co.uk" title="fake rolex watches">fake
rolex watches</a>
decorated by the lines from the inside out, even between the square
inch, but also filling the <a href="http://www.fashionwatches.org.uk"
title="replica watches uk">replica watches uk</a>
heart design and craftsmanship, it is beautiful. Case is side with a
matte and brushed metal texture of <a
href="http://www.replicaswatchesuks.co.uk"
title="replica watches">replica watches</a>
stainless steel, durable wear, it is the embodiment of men&#39;s strong
just positive character.


Geugeot

Posted on : February 05, 2018

We all so much lucky to receive your posts to reduce data loss in <a
href="http://www.australian-writings.org/">best assignment service</a>
optimistic currency. That they all given to manage the blog provided
new solution and hank you.<br />


Post a Comment

Tags

MoCA

MoCA Offline

Unmapped profiles

CRM organization import

Input Parameters

CRM Plugin

Plugin context

Outlook Client

Outlook Client Statistics

Performance

Plugin execution time

Debug Javascript

Debug Javascript in MoCA

Optimistic Concurrency

RowVersion

IfRowVersionMatches

IsOptimisticConcurrencyEnabled

Dynamics CRM 2016

new capabilities in CRM 2016

CRM 2016 Release Preview

What's new in CRM 2016

What's coming in CRM 2016

CRM 2016 Release Notes

CRM Online

CRM On Premise

Online vs On Premise

Online and On Premise comparison

CRM 2015

Stored Procedure

Out of the Box Stored Procedure

OOTB Stored Procedure

OOTB

OOTB SP

SP

Xrm Snippets

CRM JavaScript

JavaScript

Full Text Search

FTS

CRM 2015 UR1

Everything about Full Text Search

Multi Entity Search Performance issue

Enable Full Text Search in CRM

InterviewQuestions

CRM Interview Question

Interview Question

Interview Questions

MSCRM Interview Question

Microsoft CRM Interview Question

Configure columns for Multi Entity Search

Multi Entity Search

Configure View Columns

View Columns for Multi Entity Search

Configure Global Search view

configure view Columns

Dynamics 365

Dynamics 365 Update 1

8 2 1

Data Import

Data Import permission

MSCRM Data Import

MSCRM

MSCRM Import

MSCRM Data Import privileges

MSCRM Data Import Security Role

Business Process Flow

Business Process Flow Enhancements

Business Process Flow with Dynamics 365

CRM 8 2 1 Business Process Flow

Dynamics 365 Business Process Flow

Concurrent Business Process Flow

WebApi

Generic WebApi library for CRM

WebApi for CRM

WebApi library for CRM

CRM

WebApi

Webpi for Dynamics CRM

WebApi for Dynamics 365

Generic library

generic Web Api

Business Process Flow issues

Business Process Flow issues and solution

Dynamics 365 Business Process Flow issues

Upgrade Plugin to Sandbox Mode

Sandboxed

Sandboxed Plugins

Move Plugins to Sandbox Mode

Move Plugins to Sandbox Mode Customization xml

Customization xml edit for Plugin

Move None to Sandbox

Move None to Sandbox CRM Plugin

last login date

last access date

last access time

user access

user access audit

last login time

CRM last login date

CRM last access date

CRM last access time

CRM user access

CRM user access audit

CRM last login time

User Access Online

Last Login CRM Online

Default Business Process Flow

Default Process Flow on Load

Default Business Process Flow On Load

Default Business Process Flow on Create

Default Process flow on Create

ADX Portal

ADX Portal Source code

Microsoft Dynamics 365 Portals

Dynamics 365 Portals

Portals

UnsupportedCode

Unsupported Code

Delete Reports

Delete Reports form CRM

Delete Managed Reports

Delete Out of the Box Reports

Delete CRM Reports

Unsupported CRM Code

Dynamics 365 WebAPI

Dynamics 365 WebAPI update lookup

Update Lookup WebAPI

WebAPI for CRM Update

Update Lookup CRM WebAPI

Update Customer lookup via webapi

Update Regarding lookup via WebAPI