PluginRegistration icon indicating copy to clipboard operation
PluginRegistration copied to clipboard

Disable checkbox for Preimage on step of type `create` to avoid exception

Open imranakram opened this issue 5 years ago • 0 comments

When we try to register an pre-image on a step based on "Create" message, the system fails by giving an exception with a message: Message Create does not support this image type. Disable the checkbox instead and show this as a message on tool tip.

`Unhandled Exception: System.ServiceModel.FaultException

Message Create does not support this image type.


Server stack trace: 
   at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
   at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
   at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

Exception rethrown at [0]: 
   at Microsoft.Xrm.Tooling.Connector.CrmServiceClient.Create(Entity entity)
   at Xrm.Sdk.PluginRegistration.Helpers.RegistrationHelper.RegisterImage(CrmOrganization org, CrmPluginImage image, CrmPluginStep step) in C:\...\PluginRegistration\Xrm.Sdk.PluginRegistration\Helpers\RegistrationHelper.cs:line 216
   at Xrm.Sdk.PluginRegistration.Helpers.RegistrationHelper.RegisterImage(CrmOrganization org, CrmPluginImage image) in C:\...\PluginRegistration\Xrm.Sdk.PluginRegistration\Helpers\RegistrationHelper.cs:line 187
   at Xrm.Sdk.PluginRegistration.Forms.ImageRegistrationForm.btnRegister_Click(Object sender, EventArgs e) in C:\...\PluginRegistration\Xrm.Sdk.PluginRegistration\Forms\ImageRegistrationForm.cs:line 247

Detail: 
<OrganizationServiceFault xmlns="http://schemas.microsoft.com/xrm/2011/Contracts" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
  <ActivityId>b1ced61c-3045-4c30-a04b-a39e23dde499</ActivityId>
  <ErrorCode>-2147204755</ErrorCode>
  <ErrorDetails xmlns:a="http://schemas.datacontract.org/2004/07/System.Collections.Generic">
    <KeyValuePairOfstringanyType>
      <a:key>ApiExceptionSourceKey</a:key>
      <a:value i:type="b:string" xmlns:b="http://www.w3.org/2001/XMLSchema">Plugin/Microsoft.Crm.ObjectModel.SdkMessageProcessingStepImageService</a:value>
    </KeyValuePairOfstringanyType>
    <KeyValuePairOfstringanyType>
      <a:key>ApiOriginalExceptionKey</a:key>
      <a:value i:type="b:string" xmlns:b="http://www.w3.org/2001/XMLSchema">Microsoft.Crm.CrmException: Message Create does not support this image type. ---&gt; Microsoft.Crm.CrmException: Message Create does not support this image type.
   at Microsoft.Crm.ObjectModel.SdkMessageProcessingStepImageServiceInternal`1.ValidateData(IBusinessEntity entity, ExecutionContext context, Boolean isUpdate)
   at Microsoft.Crm.ObjectModel.SdkMessageProcessingStepImageServiceInternal`1.Create(IBusinessEntity entity, ExecutionContext context)
   --- End of inner exception stack trace ---
   at Microsoft.Crm.Extensibility.VersionedPluginProxyStepBase.Execute(PipelineExecutionContext context)
   at Microsoft.Crm.Extensibility.PipelineInstrumentationHelper.Execute(Boolean instrumentationEnabled, String stopwatchName, ExecuteWithInstrumentation action, PipelineExecutionContext context)
   at Microsoft.Crm.Extensibility.Pipeline.&lt;&gt;c__DisplayClass3_0.&lt;RunStep&gt;b__0()</a:value>
    </KeyValuePairOfstringanyType>
    <KeyValuePairOfstringanyType>
      <a:key>ApiStepKey</a:key>
      <a:value i:type="b:guid" xmlns:b="http://schemas.microsoft.com/2003/10/Serialization/">64cabb1b-ea3e-db11-86a7-000a3a5473e8</a:value>
    </KeyValuePairOfstringanyType>
    <KeyValuePairOfstringanyType>
      <a:key>ApiDepthKey</a:key>
      <a:value i:type="b:int" xmlns:b="http://www.w3.org/2001/XMLSchema">1</a:value>
    </KeyValuePairOfstringanyType>
    <KeyValuePairOfstringanyType>
      <a:key>ApiActivityIdKey</a:key>
      <a:value i:type="b:guid" xmlns:b="http://schemas.microsoft.com/2003/10/Serialization/">b1ced61c-3045-4c30-a04b-a39e23dde499</a:value>
    </KeyValuePairOfstringanyType>
    <KeyValuePairOfstringanyType>
      <a:key>ApiPluginSolutionNameKey</a:key>
      <a:value i:type="b:string" xmlns:b="http://www.w3.org/2001/XMLSchema">System</a:value>
    </KeyValuePairOfstringanyType>
    <KeyValuePairOfstringanyType>
      <a:key>ApiStepSolutionNameKey</a:key>
      <a:value i:type="b:string" xmlns:b="http://www.w3.org/2001/XMLSchema">System</a:value>
    </KeyValuePairOfstringanyType>
    <KeyValuePairOfstringanyType>
      <a:key>ApiExceptionCategory</a:key>
      <a:value i:type="b:string" xmlns:b="http://www.w3.org/2001/XMLSchema">ClientError</a:value>
    </KeyValuePairOfstringanyType>
    <KeyValuePairOfstringanyType>
      <a:key>ApiExceptionMesageName</a:key>
      <a:value i:type="b:string" xmlns:b="http://www.w3.org/2001/XMLSchema">SdkMessageInvalidImageTypeRegistration</a:value>
    </KeyValuePairOfstringanyType>
    <KeyValuePairOfstringanyType>
      <a:key>ApiExceptionHttpStatusCode</a:key>
      <a:value i:type="b:int" xmlns:b="http://www.w3.org/2001/XMLSchema">400</a:value>
    </KeyValuePairOfstringanyType>
    <KeyValuePairOfstringanyType>
      <a:key>0</a:key>
      <a:value i:type="b:string" xmlns:b="http://www.w3.org/2001/XMLSchema">Create</a:value>
    </KeyValuePairOfstringanyType>
  </ErrorDetails>
  <HelpLink>http://go.microsoft.com/fwlink/?LinkID=398563&amp;error=Microsoft.Crm.CrmException%3a8004416d&amp;client=platform</HelpLink>
  <Message>Message Create does not support this image type.</Message>
  <Timestamp>2020-04-23T08:23:29.1259145Z</Timestamp>
  <ExceptionRetriable>false</ExceptionRetriable>
  <ExceptionSource i:nil="true" />
  <InnerFault>
    <ActivityId>b1ced61c-3045-4c30-a04b-a39e23dde499</ActivityId>
    <ErrorCode>-2147204755</ErrorCode>
    <ErrorDetails xmlns:a="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
    <HelpLink i:nil="true" />
    <Message>Message Create does not support this image type.</Message>
    <Timestamp>2020-04-23T08:23:29.1259145Z</Timestamp>
    <ExceptionRetriable>false</ExceptionRetriable>
    <ExceptionSource i:nil="true" />
    <InnerFault i:nil="true" />
    <OriginalException i:nil="true" />
    <TraceText i:nil="true" />
  </InnerFault>
  <OriginalException i:nil="true" />
  <TraceText i:nil="true" />
</OrganizationServiceFault>

imranakram avatar Apr 23 '20 08:04 imranakram