EntityCollection businessEntityCollection = (EntityCollection)context.OutputParameters["BusinessEntityCollection"];
businessEntityCollection.Entities.Clear();
Task<List<Entity>> injectedEntityCollection = IntegrationHelper.GetResponseEntities(organizationService,context.PrimaryEntityName, true, requestId, serviceProvider);
List<Entity> entities = injectedEntityCollection.Result;
// injectedEntityCollection = FilterResponseEntities(injectedEntityCollection, query, serviceProvider, serviceData);
// injectedEntityCollection = SortResponseEntities(injectedEntityCollection, query);
businessEntityCollection.Entities.AddRange(entities);
context.OutputParameters["BusinessEntityCollection"] = businessEntityCollection;
I create retreive multiple plugin and registered on entity. The plugin logic is as below. the plugin code does make a call to one of external web api call and creating collection and assigning the entity collection to businessentity collection. the code works fine while debugging it could inject business entity collection with the list retrieve but not able to render the subgrid and throwing below error. Could you please any one suggest on this? How to proceed this is blocking one of my task.
Unhandled Exception: System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.SecurityPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
at System.StubHelpers.StubHelpers.DemandPermission(IntPtr pNMD)
at Microsoft.XamlDiagnostics.WpfTap.NativeMethods.GetWindowLong(IntPtr hWnd, Int32 nIndex)
at Microsoft.XamlDiagnostics.WpfTap.WpfVisualTreeService.Adorners.AdornerLayerWindow.get_IsTargetWindowTopmost()
at Microsoft.XamlDiagnostics.WpfTap.WpfVisualTreeService.Adorners.AdornerLayerWindow.BringToTopIfNeeded()
at Microsoft.XamlDiagnostics.WpfTap.WpfVisualTreeService.Adorners.AdornerLayerWindow.UpdatePlacement()
at Microsoft.XamlDiagnostics.WpfTap.WpfVisualTreeService.Adorners.AdornerLayerWindow.<UpdatePlacementAsync>b__77_0(Object obj)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.DispatcherOperation.InvokeImpl()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at MS.Internal.CulturePreservingExecutionContext.Run(CulturePreservingExecutionContext executionContext, ContextCallback callback, Object state)
at System.Windows.Threading.DispatcherOperation.Invoke()
at System.Windows.Threading.Dispatcher.ProcessQueue()
at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
at System.Windows.Window.ShowHelper(Object booleanBox)
at System.Windows.Window.ShowDialog()
at Microsoft.Crm.Tools.PluginRegistration.OrganizationControlViewModel.LoadDebugPluginUserControl()
at Microsoft.Crm.Tools.PluginRegistration.OrganizationControlViewModel.Debug_Clicked()