Quantcast
Channel: XAF Team Blog
Viewing all articles
Browse latest Browse all 148

Merge Changes when Two Users Edit the Same Record Simultaneously

$
0
0

In multi-user data-aware applications, there are times when one user edits a record while another user is editing the same record. As long as the changes being made do not affect the same field (e.g., one user modifies the task description while another user attaches a file), XAF can resolve the situation, and merge simultaneous changes made by different users. The following video demonstrates this scenario.

To try out this functionality (which will be available in version 13.1 of XAF), add the following code to your Program.cs file.

staticvoid Main() {
DevExpress.Xpo.XpoDefault.TrackPropertiesModifications = true;
// ...
}
 
Note that ASP.NET applications are not supported, because user interaction dialogs are currently only implemented for WinForms. The core helper classes are located in the DevExpress.ExpressApp.Xpo assembly so that support for ASP.NET can be added in the future.
 

Important note:

To support this functionality, persistent properties should be implemented in a specific manner. If you implement your business model in code, then follow XPO best practices and use either the SetPropertyValue or OnChanged method in persistent property setters. These methods have several overloads. Use the overloads that take both the old and new property values:

SetPropertyValue("PropertyName", ref propertyValueHolder, value);
 
OnChanged("PropertyName", propertyValueHolder, value)


If you use the Data Model Designer or Business Object Designer to create the data model, then you do not need to worry about implementing persistent properties. Designers automatically declare persistent properties in the proper manner.
 
If you have any questions about this functionality, feel free to leave a comment below.

Viewing all articles
Browse latest Browse all 148

Trending Articles