web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

How to prevent 2 people from modifying the same record at the same time on the form like Lead or Opportunity?

(0) ShareShare
ReportReport
Posted on by

Hi,

I am using MS Dynamics CRM 2015.

How to prevent 2 people from modifying the same record at the same time on the form like Lead or Opportunity ?

Thanks in advance.

 

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Community Member Profile Picture
    on at

    Give user level update rights to roles. Only the owner of the record will be able to modify the record.

  • Cyclefitness Profile Picture
    on at

    Question to Vikas:  If you grant User level access by virtue of Team membership only, then anyone on the team can edit.  The multi-user edit is still prevented by Ownership?  And what if a Team owns the record?

  • abhishek_255 Profile Picture
    1,614 on at

    You can't do it in web application, however it can be achievable through SDK calls (Enable Optimistic Concurrency) and web API (IF-MATCH)

    I had a thought if we could create a plugin and register it on Update message and Pre-Operation stage. Since pre-operation stage will be in database transaction. Here read the row version that currently exists in database and compare it to the version of record that you are trying to update. In case version mismatches (some other source/user has already updated that record) throw exception else proceed the process as-is. 

     Entity sourceEntity = (Entity)context.InputParameters["Target"]; 

    Entity et = service.Retrieve("account", new Guid(sourceEntity .Attributes["id"].ToString()), new ColumnSet(true));

    if (et.RowVersion != sourceEntity.RowVersion)

    throw new InvalidPluginExecutionException("The version of record you are working is already been updated");

     

    If my response is helps you, please mark as "Verified"

  • Community Member Profile Picture
    on at

    Why? When a record is saved, only the updated fields are written back to the database, so two users could edit different parts of the same record with no conflict.

    What do you want to happen to the changes the second person wanted to make? Just abandon them? If you stop them saving the record, they can't easily keep anything - reloading the form to see what is there will lose their changes.

  • Kronecker Profile Picture
    on at

    1. Create custom mapping field to users that represents the user who is currently performing modifications on the record.

    2. Create 2 custom buttons on the ribbon like Lock and Unlock

    2. Write Javascript code form's onload event

    2.1 Check custom mapping field has a value

    if it has no value, then display Lock button and hide Unlock button;

    else

    check if the value matches with current user's id then let it go and hide Lock button;

    else disable the desired fields and hide both Lock and Unlock buttons.

    You should also write a plug-in to provide security if you desire.

    In addition, you need to write actions for the two buttons that I mentioned.

  • Suggested answer
    Community Member Profile Picture
    on at

    Debra, if you use a team then all members of that team should be able to edit the record.

  • Rickard Norström Profile Picture
    on at

    You would have to implement something like Kronecker is suggesting. You need a checkout-checkin logic which is in not only trivial to implement, plus if a user is forgetting the lock, that record is, well, locked.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans