Skip to main content
Suggested answer

HTML Code in InvalidPluginExecutionException Message on Connection Form

editSubscribe (0) ShareShare
Posted on by 168

Hi everybody,

I hope you are well. I have an Dynamics 365 and have the Problem, that the Message for InvalidPluginExecutionException contains only on the connection Form HTLM Code in the error Message.

I registered the same Plugin on the contact Form and the message is right. See below picture


Error Message in Contact:


Error Message in Connection:


My Code:


if (context.InputParameters.Contains("Target") &&
                context.InputParameters["Target"] is Entity)
                // Obtain the target entity from the input parameters.  
                Entity entity = (Entity)context.InputParameters["Target"];

                // Obtain the organization service reference which you will need for  
                // web service calls.  
                IOrganizationServiceFactory serviceFactory =
                IOrganizationService service = serviceFactory.CreateOrganizationService(context.UserId);

                    var owner = entity.GetAttributeValue("ownerid");
                    if (owner.LogicalName == "systemuser")
                        throw new InvalidPluginExecutionException(OperationStatus.Canceled);
                } catch(InvalidPluginExecutionException ex)
                    throw new InvalidPluginExecutionException("Heute war ein guter Tag.", ex);

Anybody an Idea how can i fix it?

Thanks for help.