I am stumped beyond belief with a plugin that should be working. Here's the scenario, running in Dynamics 365 Online:
I have an entity that has a plugin registered for Retrieve. The plugin takes an entity, queries an external source, and augments the data being returned with additional fields from this external source. The design is to register the synchronous event as Post Operation, returning the augmented entity as the output parameter for the plugin context.
context.OutputParameters["BusinessEntity"] = entity;
I have plugin trace enabled in my environment, which typically works well except for this specific plugin. I have other plugins that do similar things, but those all work except for this one.
If I register the Retrieve step as pre-validation or pre-operation, trace works well but neither of these stages will allow me to return the entity as an output parameter.
If I register the Retrieve step as post-operation so that I can return my custom entity as an output parameter, I get no trace, no plugin profile, and when using the model-driven UI to view the record, I get an ugly message in the UI that states:
When using the odata API, I just get a message stating that it cannot find the record regardless of which stage I use for the plugin:
I've removed the augmenting code so that it will just return the data. I've traced the return object with the pre-events, and it appears to be setting the output parameter correctly. I've even tried to throw an InvalidPluginExecutionException at the beginning of the plugin just to get trace or profiling to work, but no luck. Without having any visibility into the execution context (trace or profiler), I have exhausted the options I am aware of.
Can someone help me with this issue? Searching the web for PutInternal yields no results relevant to Dataverse or Dynamics, so I fear this is a new issue that was recently introduced by the platform.
Thank you.