Unable to retrieve Security Roles from Child Business Unit

Dec 19, 2015 at 9:57 PM
It seems like not able to retrieve Security Roles from child Business Unit. Anyone having the same problem? Much appreciate for any reply.



Regards,
summerap
Coordinator
Dec 22, 2015 at 4:09 AM
Hi Summerap,

The tool as of now retrieves Roles only from root Business Unit. Will consider this for the next update. Thanks for the suggestion.

Regards,
Johninfant
Coordinator
Dec 22, 2015 at 4:12 AM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
Coordinator
Dec 30, 2015 at 6:19 PM
Hi Summerap,

Please download the latest release, and let me know if you have any issues. Thanks for your feedback.

Regards,
Johninfant
Marked as answer by Johninfant on 12/30/2015 at 10:19 AM
Dec 31, 2015 at 12:51 PM
Hi,

I'm able to retrieve all the roles ok, but when I export anything it just throws an exception and closes down the program...
I've tried in an On-premise and Office365 having the same problem in both. I'm using the root Business Unit also.

Any help will be very welcome :)

Regards
Coordinator
Jan 1, 2016 at 6:24 AM
Hi jporrasc,

Can you please share a screenshot of when the error occurs? What is the message in console, when the error occurs. any info on this would be much helpful.

Thanks,
John
Jan 4, 2016 at 2:44 PM
Edited Jan 4, 2016 at 2:45 PM
Hi Johninfant,

I'm having the same issue than jporracs.

Here you have the exception that it's been registered in the event viewer:


Application: RoleSheetExporter.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.Data.ConstraintException
Stack:
at System.Data.DataTable.InsertRow(System.Data.DataRow, Int64, Int32, Boolean)
at System.Data.DataRowCollection.Add(System.Data.DataRow)
at RoleSheetExporter.MainWindow.InitializeNewDataTable(System.String, Boolean)
at RoleSheetExporter.MainWindow.InitializeNewDataSet()
at RoleSheetExporter.MainWindow.RetrieveRolePrivileges(Int32)
at RoleSheetExporter.MainWindow.btnExport_Click(System.Object, System.Windows.RoutedEventArgs)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(System.Object, System.Windows.RoutedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(System.Object, System.Windows.RoutedEventArgs, Boolean)
at System.Windows.UIElement.RaiseEventImpl(System.Windows.DependencyObject, System.Windows.RoutedEventArgs)
at System.Windows.UIElement.RaiseEvent(System.Windows.RoutedEventArgs)
at System.Windows.Controls.Primitives.ButtonBase.OnClick()
at System.Windows.Controls.Button.OnClick()
at Microsoft.Windows.Controls.Ribbon.RibbonButton.OnClick()
at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(System.Windows.Input.MouseButtonEventArgs)
at System.Windows.UIElement.OnMouseLeftButtonUpThunk(System.Object, System.Windows.Input.MouseButtonEventArgs)
at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(System.Delegate, System.Object)
at System.Windows.RoutedEventArgs.InvokeHandler(System.Delegate, System.Object)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(System.Object, System.Windows.RoutedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(System.Object, System.Windows.RoutedEventArgs, Boolean)
at System.Windows.UIElement.ReRaiseEventAs(System.Windows.DependencyObject, System.Windows.RoutedEventArgs, System.Windows.RoutedEvent)
at System.Windows.UIElement.OnMouseUpThunk(System.Object, System.Windows.Input.MouseButtonEventArgs)
at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(System.Delegate, System.Object)
at System.Windows.RoutedEventArgs.InvokeHandler(System.Delegate, System.Object)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(System.Object, System.Windows.RoutedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(System.Object, System.Windows.RoutedEventArgs, Boolean)
at System.Windows.UIElement.RaiseEventImpl(System.Windows.DependencyObject, System.Windows.RoutedEventArgs)
at System.Windows.UIElement.RaiseTrustedEvent(System.Windows.RoutedEventArgs)
at System.Windows.UIElement.RaiseEvent(System.Windows.RoutedEventArgs, Boolean)
at System.Windows.Input.InputManager.ProcessStagingArea()
at System.Windows.Input.InputManager.ProcessInput(System.Windows.Input.InputEventArgs)
at System.Windows.Input.InputProviderSite.ReportInput(System.Windows.Input.InputReport)
at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr, System.Windows.Input.InputMode, Int32, System.Windows.Input.RawMouseActions, Int32, Int32, Int32)
at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr, MS.Internal.Interop.WindowMessage, IntPtr, IntPtr, Boolean ByRef)
at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
at MS.Win32.HwndWrapper.WndProc(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(System.Object)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr, Int32, IntPtr, IntPtr)
at MS.Win32.UnsafeNativeMethods.DispatchMessage(System.Windows.Interop.MSG ByRef)
at System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame)
at System.Windows.Threading.Dispatcher.PushFrame(System.Windows.Threading.DispatcherFrame)
at System.Windows.Threading.Dispatcher.Run()
at System.Windows.Application.RunDispatcher(System.Object)
at System.Windows.Application.RunInternal(System.Windows.Window)
at System.Windows.Application.Run(System.Windows.Window)
at RoleSheetExporter.App.Main()

Thanks in advance,
Fernando.
Coordinator
Jan 5, 2016 at 4:09 PM
Hi Fernando/Jose,

Thanks for the error log. Still I wasn't able to replicate the issue here. I tried with CRM 2015 Online. However, I have identified the probable point of exception. So I have added a log message statement. Hopefully there should be a message in console like, "Skipping duplicate Entity/Privilege: XXXXXXXXXXXXX". Can you please let me know what is the XXXXXXXXXXXXXXX part in this message? If you are still facing any problems, please let me know.

Thanks,
John
Jan 7, 2016 at 1:27 PM
Hi John,

I don't understand if you have changed or update the version of the program o not (excuse my english).
I've downloaded RoleSheetExporter with the same results.

In my case is a On Premise CRM 2011.

Here you have an screenshot of the error, with the console.

https://drive.google.com/file/d/0B37xK9JvBMPzMHRYZkRNM3B2a0U/view?usp=sharing

Thanks,
Fernando
Jan 8, 2016 at 9:08 AM
Hi John,

I've tried with the CRM in English and works fine :)
Would be possible to make it work in Spanish too in a near future?

Thanks
Regards
Coordinator
Jan 8, 2016 at 2:16 PM
Hi Fernando,

As per my discussion with Jose, the tool works fine for English, but doesn't work for Spanish. Is this the same case for you as well?

Regards,
John
Coordinator
Jan 8, 2016 at 2:57 PM
Hi Jose/Fernando,

Just tested after changing my language in Online Trial to Spanish, and found that there are two entities with the same name in core records tab.

Image
Jan 12, 2016 at 7:38 AM
Hi

I am experiencing the same issue as Fernando. I am connecting to onprem, the base language is Danish but when i export it just crashes on the first security role with a null reference exception. I can only change the UI language and Help language to English on prem and even when i do this i still get the same exception. I have tried on a different onprem env base language English and that works fine. Is there an issue with exporting roles from non English base CRM ? or is there some kind of workaround please?

Thanks
Charmaine
Jan 12, 2016 at 9:10 AM
Hi John,

I doubt if my problem is the same than Jose and Charmaine... In my case the base languaje is English like the UI language.
I've downloaded the last version 3.2 and now the trace of the error is distinct:

Application: RoleSheetExporter.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.NullReferenceException
Stack:
at RoleSheetExporter.MainWindow.<orgParameteredCallBack>b__6(Microsoft.Xrm.Sdk.Metadata.EntityMetadata)
at System.Linq.Enumerable+WhereArrayIterator`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].MoveNext()
at RoleSheetExporter.MainWindow.orgParameteredCallBack(Microsoft.Xrm.Sdk.OrganizationResponse, System.Object)
at AsyncServices.AsyncService.newOrgWorker_RunWorkerCompleted(System.Object, System.ComponentModel.RunWorkerCompletedEventArgs)
at System.ComponentModel.BackgroundWorker.OnRunWorkerCompleted(System.ComponentModel.RunWorkerCompletedEventArgs)
at System.ComponentModel.BackgroundWorker.AsyncOperationCompleted(System.Object)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
at System.Windows.Threading.DispatcherOperation.InvokeImpl()
at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(System.Object)
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
at System.Windows.Threading.DispatcherOperation.Invoke()
at System.Windows.Threading.Dispatcher.ProcessQueue()
at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
at MS.Win32.HwndWrapper.WndProc(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(System.Object)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr, Int32, IntPtr, IntPtr)
at MS.Win32.UnsafeNativeMethods.DispatchMessage(System.Windows.Interop.MSG ByRef)
at System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame)
at System.Windows.Threading.Dispatcher.PushFrame(System.Windows.Threading.DispatcherFrame)
at System.Windows.Threading.Dispatcher.Run()
at System.Windows.Application.RunDispatcher(System.Object)
at System.Windows.Application.RunInternal(System.Windows.Window)
at System.Windows.Application.Run(System.Windows.Window)
at RoleSheetExporter.App.Main()

Regards,
Fernando
Coordinator
Jan 12, 2016 at 10:54 AM

Hi Fernando,

I think the issue is with cached metadata. This is done to reduce the tool load time.

In the tool ribbon, can you refresh the metadata and try once?

Coordinator
Apr 6, 2016 at 9:01 AM
Hi Fernando,

This issue is fixed in the latest release. Sorry for the delay, my Notebook crashed and I lost the code. :(

Anyway thanks for reporting.

Regards,
John
Coordinator
Apr 6, 2016 at 9:03 AM
Hi Summerap,

Since I lost the code recently, I had a backup taken before V3.2 only. I have used that for issue fix now. Unfortunately that removed the child business unit selection option.

I will be adding the option back in a couple of days. Thanks for supporting.


Regards,
John