How To

Remove Items from the Compare Result

Using the Project Automation feature you can intercept the comparison results and disable items for synchronisation by setting the Sync property false. This has the same effect as un-checking items in the Data Sync UI manually.

With some basic C# code in Project Automation we can automatically remove items from the sync where there is only 1 change the Updated field in this example. In this case we need at least 2 columns to have changed to send the results to the server.

Compare Result

The code below looks at the Updated items collection after the comparison phase and before the synchronisation. The Row collection lists the changed columns for the row we use this to decide whether to disable the item for synchronisation.

public override void BeforeSynchronisation(ProjectAutomationCompareResult compareResult)
        //Disable Update on all Items where there is only 1 change i.e. Date Modified
        compareResult.Updated.Where(i => i.Row.Count == 1).ToList().ForEach(i => i.Sync = false);