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 throw new InvalidPluginExecutionException("Error occurred in MethodName:" + ex.Message);
. It does not fail or stop but just continues in a waiting status.
I have tried to Reset :
- IIS
- async service
- Sync Services (Have Tried Edit:
- Adding Version Control
- Uninstall / Reinstall assembly)
Currently I am attempting to pull the activity id of the PrimaryEntityId
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.
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;
Any ideas on what could be causing this?
Thanks,