Notifications
Announcements
No record found.
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
Give user level update rights to roles. Only the owner of the record will be able to modify the record.
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?
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"
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.
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.
Debra, if you use a team then all members of that team should be able to edit the record.
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.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
SA-08121319-0 4
Calum MacFarlane 4
Alex Fun Wei Jie 2