Order is edited by multiple users Error


In my current project we have integrated order with our financial system and also we are using third party tool to generate order line items. After some time in production we started getting issue “Order is edited by multiple users” , and we were getting this issue only some times. After doing lot’s of testing what I found my order update plugin is called multiple times. After doing lot’s debugging what I found in my plugin context.depth is 1 but ever time correlationId was different. So I solved this issue by including below code in my plugin

if (_CorrelationID == Guid.Empty)
_CorrelationID = Context.CorrelationId;
else
{
if (_CorrelationID != Context.CorrelationId)
return;
}
try
{
// rest of the code
}
catch()
{//handle exception}
finally
{
_CorrelationID= Guid.Empty;}
This piece of code fixed my issue

Advertisements

4 Comments

Filed under MS CRM 4.0, Workflow & Plugin Development

4 responses to “Order is edited by multiple users Error

  1. Kirsh

    Hi Mahendrapal,

    I am same infinte loop error for plug-in update.Can you please let me know where to use this above code

    Thanks,
    Kirsh

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s