locked
Run Workflow.... Waiting Status... But workflow Works?? RRS feed

  • Question

  • Hi everyone...

    When I run the workflow it always hangs as "Waiting". However, the functionality of the workflow is working perfectly.

    The error I am getting is

    <Message>System.ArgumentException: Expected non-empty Guid.
    Parameter name: id</Message>

    How do I change the waiting status to Suceeded?

    Tuesday, November 15, 2011 8:03 PM

Answers

  • In the meantime I have found a direction of investigation.

    Rollup 4 fixes this issue - waited workflow in error. Expecting non empty Guid argument in upgraded (4.0 -> 2011) environment.

    So I open case on Microsoft Support to check if rollup 5 (our environment) did not revert that fix from rollup 4.

    But so far no one reacted - even people in India have Christmas and New Year. :-(

    Jiri

    Tuesday, January 3, 2012 2:49 PM

All replies

  • Hi,

    Can you please specify the version of CRM you are using?

    You can try restarting "Microsoft Dynamics CRM Asynchronous Processing" Service by navigating to Administrative Tools, then click Services, also it would be good if you post your code to look at the forum members to look at to see any specific issues.

     


    Thomas T(MCBMSS) If you find this post helpful then please "Vote as Helpful" and "Mark As Answer".
    Wednesday, November 16, 2011 1:50 AM
  • Hi,

    I am using Microsoft Dynamics CRM 2011 on Premise.

    How do I restart the CRM Asynchronous Processing in 2011. Cant seem to find the settings to do this.

    Wednesday, November 16, 2011 9:22 AM
  •  if (Template.Get<EntityReference>(executionContext) != null)
                    {
                        SendEmailFromTemplateRequest emailUsingTemplateReq = new SendEmailFromTemplateRequest
                        {
                            Target = email,

                            // Contains the data needed to send an e-mail message using a template.
                            TemplateId = Template.Get<EntityReference>(executionContext).Id,

                            // The regarding Id is required which Gets or sets the ID of the entity
                            // instance with which the e-mail message is associated.
                          RegardingType = context.PrimaryEntityName,
                          RegardingId = context.PrimaryEntityId
                        };

                        SendEmailFromTemplateResponse emailUsingTemplateResp = (SendEmailFromTemplateResponse)service.Execute(emailUsingTemplateReq);
                    }

                    else
                    {
                        Guid emailId = service.Create(email);
                        EmailOutput.Set(executionContext, new EntityReference(Email.EntityLogicalName, emailId));
                    }

     

            [Input("Template")]
            [ReferenceTarget("template")]
            public InArgument<EntityReference> Template { get; set; }

     

            [Output("The output of the Email Address")]
            [ReferenceTarget("email")]
            public OutArgument<EntityReference> EmailOutput { get; set; }

    This is part of the code that is giving me the , PublicKeyToken=31bf3856ad364e35]]: Expected non-empty Guid.Detail:" Error."

     

    The Workflow process works perfectly though. Any ideas?

     

     

     


    • Edited by davdatong Wednesday, November 16, 2011 10:18 AM
    Wednesday, November 16, 2011 10:15 AM
  • Hi,

     

    Log onto CRM Server, and follow the steps given below:

     

    Stop and Re-start the Service

    1. Navigate to Start, select Administrative Tools, then click Services.

    2. Right-click Microsoft Dynamics CRM Asynchronous Processing Service in the Name column of the service listing.

    3. Click Start or Stop. Or, you can click Properties in the shortcut menu and then click Start or Stop in the dialog box.

    You must have System Administrator privileges to stop or start the service.


    Thomas T(MCBMSS) If you find this post helpful then please "Vote as Helpful" and "Mark As Answer".
    Thursday, November 17, 2011 12:08 AM
  • Thanks for your reply.

    I restarted the CRM Asynchronous process Service, however, still get the same error. Some line in the IF statement is producing this error but I can't figure out what it is.

    Thursday, November 17, 2011 10:10 AM
  • I still haven't resolved this issue.
    Monday, November 28, 2011 11:57 AM
  • Have you signed the plug in? Step 3 in this document http://msdn.microsoft.com/en-us/library/bb955365.aspx

     


    Regards Faisal
    Monday, November 28, 2011 12:02 PM
  • Yes I have signed the custom workflow. I debugged my code and the process is perfect. The custom workflow does work as it should... but just need to remove the error message when running it.

     

    Monday, November 28, 2011 12:29 PM
  • Put it in try and catch statement http://msdn.microsoft.com/en-us/library/0yd65esw(v=vs.80).aspx
    Regards Faisal
    Monday, November 28, 2011 4:11 PM
  • Hello,

    I face the same issue like you - I need to return EntityReference - all code runs in debugger without any issue and then workflow stops with the message - expected non empty Guid.

    I have found only one article which pointed me to retype workflow because it was converted from 4.0 deployment. Unfortunatelly it did not help.

    Have you found the solution ?

    Thanks for response.

    Friday, December 23, 2011 11:08 AM
  • In the meantime I have found a direction of investigation.

    Rollup 4 fixes this issue - waited workflow in error. Expecting non empty Guid argument in upgraded (4.0 -> 2011) environment.

    So I open case on Microsoft Support to check if rollup 5 (our environment) did not revert that fix from rollup 4.

    But so far no one reacted - even people in India have Christmas and New Year. :-(

    Jiri

    Tuesday, January 3, 2012 2:49 PM
  • I am also experiencing the same issue.  I have Rollup 5 and a brand new CRM 2011 workflow (not imported from CRM 4.0).  All code works as expected until the entity reference is returned to the workflow at which point I get the System.ArgumentException: Expected non-empty Guid error.  Has anyone received a reply on this issue?

    huh

    Tuesday, February 14, 2012 8:35 AM
  • Make sure, that entityreference is returned in your custom activity in any case.

    What causes this error is situation like this:

    if (something) then output is set to value else return

    output is outargument of entityreference type

    It seems like platform is checking the out argument in any case and you have to provide.

    So I changed my code in such way an it worked perfect:

    set hasoutput to 0 (out int argument)

    set output to new reference with newly generated guid (not valid reference in fact)

    if (something) then set output to proper value; set hasoutput to 1 else return

    And in workflow I check hasoutput before I use returned entity reference. This worked and playing with returning a null as entity reference did not work.

    Hope it helps.

    • Proposed as answer by RyanLopez Wednesday, February 15, 2012 6:45 AM
    • Unproposed as answer by RyanLopez Wednesday, February 15, 2012 6:46 AM
    Tuesday, February 14, 2012 6:19 PM
  • Thanks Silver100! Your suggestion got me thinking in another direction.  In my case, I ALWAYS return a Contact entity reference as I get the contact from an ActivityPartyList from Email.From.  It appears that the EntityReference in ActivityParty.PartyId is where the problem is and returning that reference causes the workflow to fail.  I created a new EntityReference from the ActivityParty.PartyId.Id and 'voila!' it worked.  I have included a code snippet:

     // out arg def
                [Output("Contact")]
                [ReferenceTarget(Contact.EntityLogicalName)]
                public OutArgument<EntityReference> ContactId { getset; }
     
     
                // Execute method snippet
     
                // get email sender (in our case it is always a Contact)
                var emailId = EmailId.Get<EntityReference>(executionContext).Id;
                var email = new EmailProvider(orgService, emailId);  //custom class to return data
                var senders = email.Data.From;
     
                // get the first (and only) sender and populate appropriate output
                if (senders.Count() <= 0 || senders.First() == nullreturn;    // abort w/f
     
                var sender = senders.First().PartyId;
                var er = new EntityReference(Contact.EntityLogicalName, sender.Id); 
                ContactId.Set(executionContext, er);    //this works
                //ContactId.Set(executionContext, sender);  // this does not work

    huh

    • Proposed as answer by RyanLopez Wednesday, February 15, 2012 6:53 AM
    Wednesday, February 15, 2012 6:52 AM