title: CRM 2011 Custom Workflow Continually in 'Waiting' Status
body: <p>I am working on a Custom Workflow within CRM 2011. I have created the workflow to create a couple of records (invoice and invoice product) once I get a particular type of Activity (a custom activity). During the testing I passed the particular GUID of the entity I would be working with (the creation of said entity would be the trigger for the workflow). The workflow works fine when I pass in a GUID for the record I want to work with. However, once I load the dll File inside CRM and attempt to trigger the workflow it goes into a waiting status and stays there. I have try catch blocks on all of my functions with a <code>throw new InvalidPluginExecutionException("Error occurred in  MethodName:" + ex.Message);</code>. It does not fail or stop but just continues in a waiting status.</p>
  
  <p>I have tried to Reset : </p>
  
  <ul>
  <li>IIS </li>
  <li>async service</li>
  <li>Sync Services
  (Have Tried Edit:</li>
  <li>Adding Version Control</li>
  <li>Uninstall / Reinstall assembly)</li>
  </ul>
  
  <p>Currently I am attempting to pull the activity id of the <code>PrimaryEntityId</code> as my primary entity is the record I need to use for the workflow. The only thing that I need from that record is the ID.</p>
  
  <pre><code>public String GetFeeId(WorkFlowHelper workFlowHelper, CodeActivityContext executionContext)
      {
          String feeRecordId = string.Empty;
          try
          {
              var primaryEntity = workFlowHelper.workFlowContext.PrimaryEntityId;
              if (primaryEntity != null)
              {
                  feeRecordId = workFlowHelper.workFlowContext.PrimaryEntityId.ToString();
              }
              if (primaryEntity == null)
              {
                  workFlowHelper.WorkFlowError("Primary Entity is null");
              }
          }
          catch (Exception ex)
          {
              if (workFlowHelper.debugMessagesOn == true)
              {
                  Console.WriteLine("Id is blank!");
              }
              workFlowHelper.WorkFlowError(ex.ToString());
              throw new InvalidPluginExecutionException("Error occured in ConnectionInfo Method:" + ex.Message);
          }
          return feeRecordId;
  </code></pre>
  
  <p>Any ideas on what could be causing this? </p>
  
  <p>Thanks,</p>