locked
CRM 4.0 Workflow "on demand" does not work !!! RRS feed

  • Question

  • Hello,

    I have a problem with my workflows. I have created a new workflow and I have just inserted a 2 min timeout  as only step.

    If any of the left side combos in the workflow view are selected (record created, record deleted, ...), the workflow is sucessfully executed.

    If I check the "on demand" combo, and I want to run this workflow on the Entity Type I have defined my workflow on (Addresses), the workflow is not shown in the "Workflows" Tab. I work as a systemadministrator, so the rights should be enough to run a workflow on demand.

    But I get an error when I search in Advanced Search for  System Job Errors:

    Unhandled Exception: System.Web.Services.Protocols.SoapException: Server was unable to process request.

    Detail:

    <detail>
    <error> 
    <code>0x80040216</code> 
    <description>An unexpected error occurred.</description> 
    <type>Platform</type>
    </error>
    </detail> 

    at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall) 
    at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) 
    at Microsoft.Crm.SdkTypeProxy.CrmService.RetrieveMultiple(QueryBase query) 
    at Microsoft.Crm.Asynchronous.SdkTypeProxyCrmServiceWrapper.RetrieveMultiple(QueryBase query) 
    at Microsoft.Crm.Workflow.WorkflowExpansionPlugin.GetOnDemandWorkflow(ICrmService crmService, IPluginExecutionContext context) 
    at Microsoft.Crm.Workflow.WorkflowExpansionPlugin.GetWorkflows(ICrmService crmServiceSystem, IPluginExecutionContext context) 
    at Microsoft.Crm.Workflow.WorkflowExpansionPlugin.Execute(IPluginExecutionContext context) 
    at Microsoft.Crm.Asynchronous.EventOperation.InternalExecute(AsyncEvent asyncEvent) 
    at Microsoft.Crm.Asynchronous.AsyncOperationCommand.Execute(AsyncEvent asyncEvent) 
    at Microsoft.Crm.Asynchronous.AsyncHostHandler.Handle(AsyncEvent asyncEvent) 
    at Microsoft.Crm.Asynchronous.QueueManager.PoolHandler.ProcessAsyncEvent(AsyncEvent asyncEvent)

    I do not understand where or what I am doing wrong or what this Error means ...

    Can anyone please help me ?

    Thanks in advance!


    Sorin Ratiu
    Wednesday, August 31, 2011 4:49 PM

All replies

  • Are you able to successfully activate the workflow after clicking the "on demand" check box?


    Mohit Agrawal
    Wednesday, August 31, 2011 5:21 PM
  • I can activate and deactivate the workflow without any problem. Everythig seems to work ok until I Run this workflow on demand - than I get the Error described above.


    Sorin Ratiu
    Thursday, September 1, 2011 7:16 AM
  • You might get a more informative error message if you turn on tracing.

    Here are some other users who have reported '0x80040216' errors: http://ronaldlemmen.blogspot.com/2006/01/add-dates-programmatically-to-crm.html.


    Neil Benson, CRM Addict and MVP at Customery Ltd. You can reach me on LinkedIn or Twitter. Join over 10,000 other CRM professionals on the Microsoft Dynamics CRM group on LinkedIn.

    Thursday, September 1, 2011 10:46 AM
    Moderator
  • What rollup are you on?

    Do you have other workflows running successfully? Have you tried restarting the asynch service?


    Hope this helps Adam Vero MCT
    Thursday, September 1, 2011 12:52 PM
  • There is Update Rollup 17 installed for Microsoft Dynamics CRM Server

    I cannot run any workflows on demand ... but on record changes works fine.

    Restarting async service ... did not change anything :(

    I get this error in Trace:

    [2011-09-02 09:29:06.9] Process: w3wp |Organization:84dd7749-2685-e011-b92e-005056850030 |Thread:    5 |Category: Platform.Sdk |User: e8891725-2685-e011-b92e-005046980030 |Level: Error | CompositeSoapExtensionExceptionHandler.Handle
     at CompositeSoapExtensionExceptionHandler.Handle(Stream to, Stream from, Exception exception)
     at CrmAuthenticationSoapExtensionBase.ProcessMessage(SoapMessage message)
     at SoapMessage.RunExtensions(SoapExtension[] extensions, Boolean throwOnException)
     at SoapServerProtocol.WriteException(Exception e, Stream outputStream)
     at WebServiceHandler.WriteException(Exception e)
     at WebServiceHandler.Invoke()
     at WebServiceHandler.CoreProcessRequest()
     at SyncSessionlessHandler.ProcessRequest(HttpContext context)
     at CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
     at HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
     at ApplicationStepManager.ResumeSteps(Exception error)
     at HttpApplication.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData)
     at HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr)
     at HttpRuntime.ProcessRequestNoDemand(HttpWorkerRequest wr)
     at ISAPIRuntime.ProcessRequest(IntPtr ecb, Int32 iWRType)
    >CrmSoapExtension detected non-CrmException - report will be sent to Watson:
    System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.InvalidOperationException: There was an error generating the XML document. ---> System.NullReferenceException: Object reference not set to an instance of an object.
       at Microsoft.Crm.BusinessEntities.SdkSerializationCommon.GetStateCodeName(EntitySerializationContext context, AttributeMetadata attributeMetadata, Object attributeValue, Boolean returnBaseValue)
       at Microsoft.Crm.BusinessEntities.SdkSerializationCommon.AttributeFormattedValueToString(EntitySerializationContext context, AttributeMetadata attributeMetadata, Object attributeValue)
       at Microsoft.Crm.BusinessEntities.SdkEntitySerializationStrategyBase.AttributeFormattedValueToString(EntitySerializationContext context, AttributeMetadata attributeMetadata, Object attributeFormattedValue)
       at Microsoft.Crm.BusinessEntities.EntitySerializationStrategyBase.WriteStateAttributeFormattedValue(EntitySerializationContext context, AttributeInfo attributeInfo)
       at Microsoft.Crm.BusinessEntities.EntitySerializationStrategyBase.WriteAttributeFormattedValue(EntitySerializationContext context, AttributeInfo attributeInfo)
       at Microsoft.Crm.BusinessEntities.EntitySerializationStrategyBase.WriteAttributeAttributes(EntitySerializationContext context, AttributeInfo attributeInfo)
       at Microsoft.Crm.BusinessEntities.SdkEntitySerializationStrategyBase.WriteAttributeAttributes(EntitySerializationContext context, AttributeInfo attributeInfo)
       at Microsoft.Crm.BusinessEntities.EntitySerializationStrategyBase.WriteAttribute(EntitySerializationContext context, AttributeInfo attributeInfo)
       at Microsoft.Crm.BusinessEntities.BusinessEntity.SerializeAttributes(EntitySerializationContext context, IEntitySerializationStrategy serializationStrategy)
       at Microsoft.Crm.BusinessEntities.BusinessEntityCollection.SerializeEntities(CollectionSerializationContext context, ICollectionSerializationStrategy serializationStrategy)
       at Microsoft.Crm.BusinessEntities.BusinessEntityCollection.Serialize(XmlWriter writer, Boolean includeRootElement, ICollectionSerializationStrategy serializationStrategy)
       at Microsoft.Crm.Sdk.BusinessEntityCollectionBase.WriteXml(XmlWriter writer)
       at System.Xml.Serialization.XmlSerializationWriter.WriteSerializable(IXmlSerializable serializable, String name, String ns, Boolean isNullable, Boolean wrapped)
       at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriter1.Write37_RetrieveMultipleResponse(Object[] p)
       at Microsoft.Xml.Serialization.GeneratedAssembly.ArrayOfObjectSerializer21.Serialize(Object objectToSerialize, XmlSerializationWriter writer)
       at System.Xml.Serialization.XmlSerializer.Serialize(XmlWriter xmlWriter, Object o, XmlSerializerNamespaces namespaces, String encodingStyle, String id)
       --- End of inner exception stack trace ---
       at System.Xml.Serialization.XmlSerializer.Serialize(XmlWriter xmlWriter, Object o, XmlSerializerNamespaces namespaces, String encodingStyle, String id)
       at System.Xml.Serialization.XmlSerializer.Serialize(XmlWriter xmlWriter, Object o, XmlSerializerNamespaces namespaces, String encodingStyle)
       at System.Web.Services.Protocols.SoapServerProtocol.WriteReturns(Object[] returnValues, Stream outputStream)
       at System.Web.Services.Protocols.WebServiceHandler.WriteReturns(Object[] returnValues)
       at System.Web.Services.Protocols.WebServiceHandler.Invoke()
       --- End of inner exception stack trace ---

    The problem seems to be here :

    >CrmSoapExtension detected non-CrmException - report will be sent to Watson:
    System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.InvalidOperationException: There was an error generating the XML document. ---> System.NullReferenceException: Object reference not set to an instance of an object.

     

    but I still can't figure out what I can do ...


    Sorin Ratiu

    • Edited by Sorin Ratiu Friday, September 2, 2011 7:56 AM
    • Proposed as answer by Ratiu Sorin Monday, December 12, 2011 10:39 PM
    Friday, September 2, 2011 7:31 AM
  • I figured it out for a while.

    There has been a german CRM 4.0  update on an english CRM 3.0. This is a Microsoft unresolved Bug.

    I updated now to a german CRM2011 and everything works fine again ... :)

     

    • Proposed as answer by Ratiu Sorin Monday, December 12, 2011 10:42 PM
    Monday, December 12, 2011 10:41 PM