/// <summary> /// Batch update those failed keys! /// </summary> /// <param name="keys"></param> private void ReactivateKeys(List <EntityKeyMetadata> keys) { WorkAsync(new WorkAsyncInfo { Message = "Reactivating Entity Keys", AsyncArgument = keys, IsCancelable = true, MessageWidth = 340, MessageHeight = 150, Work = (w, e) => { w.ReportProgress(0, $"Reactivating Entity Keys"); var results = CrmActions.ReactivateEntityKey(Service, keys); w.ReportProgress(100, $"Reactivating Entity Keys complete!"); e.Result = results; }, ProgressChanged = e => { SendMessageToStatusBar?.Invoke(this, new StatusBarMessageEventArgs(e.ProgressPercentage, e.UserState.ToString())); }, PostWorkCallBack = e => { // reload the list of selected entities if (e.Result != null) { var errors = (List <string>)e.Result; MessageBox.Show(this, $"The following errors occurred while attempting to activate\n{string.Join("\n", errors)}"); } // reload the list now that have made the call LoadSelectedEntityKeys(); } }); }