I am attempting to call a new action from an existing plugin that will then trigger another plugin asynchronously.
My action accepts a number of parameters -
SiteSettings - Entity - Input
quoteJson - String - Input
opportunity - Entity - Input
quoteId - String - Input
priceList - Entity - Input
Existing plugin
public class examplePlugin : IPlugin { public void Execute(IServiceProvider serviceProvider) { // Get tracing service for debugging purposes ITracingService tracingService = (ITracingService)serviceProvider.GetService(typeof(ITracingService)); // Get the context of the message IPluginExecutionContext context = (IPluginExecutionContext)serviceProvider.GetService(typeof(IPluginExecutionContext)); IOrganizationServiceFactory serviceFactory = (IOrganizationServiceFactory)serviceProvider.GetService(typeof(IOrganizationServiceFactory)); IOrganizationService dynamicsService = serviceFactory.CreateOrganizationService(context.UserId); // API name of action is new_bactchProductMapping OrganizationRequest req = new OrganizationRequest("new_bactchProductMapping"); // uses custom entity req["SiteSettings"] = siteSettings; // uses string req["quoteJSON"] = "example string"; // uses dynamics standard Opportunity entiry req["opportunity"] = opportunity; // uses string req["quoteId"] = "quoteid example"; // uses dynamics standard priceLlist entiry req["priceLlist"] = price_list; tracingService.Trace("ExamplePlugin - attempt to exicute request"); try { OrganizationResponse response = dynamicsService.Execute(req); } catch (FaultException e) { tracingService.Trace("ExamplePlugin - error = " e.Message " - " e.Reason " - " e.StackTrace); } } }
when calling the action i am hitting the below error -
ExamplePlugin - error = new_bactchProductMapping#2011/Organization.svc - new_bactchProductMapping#2011/Organization.svc - at Microsoft.CDSRuntime.SandboxWorker.SandboxCallbackService.<>c__DisplayClass14_0.<ExecuteCallBack>b__0() in C:\source\src\CDS.RunTime.Sandbox.Fabric\Microsoft.CDSRuntime.SandboxWorker\SandboxCallbackService.cs:line 109
at Microsoft.PowerApps.CoreFramework.ActivityLoggerExtensions.Execute[TResult(ILogger logger, EventId eventId, ActivityType activityType, Func`1 func, IEnumerable`1 additionalCustomProperties)
at Microsoft.CDSRuntime.SandboxWorker.SandboxCallbackService.ExecuteCallBack(Func`2 callback, Func`2 HandleClientException) in C:\source\src\CDS.RunTime.Sandbox.Fabric\Microsoft.CDSRuntime.SandboxWorker\SandboxCallbackService.cs:line 88
at Microsoft.CDSRuntime.SandboxWorker.SandboxOrganizationService.Execute(String operation, ByteString serializedRequest, Object traceSettings) in C:\source\src\CDS.RunTime.Sandbox.Fabric\Microsoft.CDSRuntime.SandboxWorker\SandboxOrganizationService.cs:line 47
at Microsoft.CDSRuntime.SandboxWorker.SandboxOrganizationServiceWrapper.ExecuteInternal(OrganizationRequest request) in C:\source\src\CDS.RunTime.Sandbox.Fabric\Microsoft.CDSRuntime.SandboxWorker\SandboxOrganizationServiceWrapper.cs:line 226
at new_Dynamics365_Plugins.ExamplePlugin.Execute(IServiceProvider serviceProvider)