I found a great article today on creating Sales Processes with Workflow in CRM 4.0. Unfortunately in my experience the workflow engine is pretty finicky, especially when it comes to using Stages. A lot of times it hangs on the wait timers.
http://www.bizitpro.com/weblog/entry/microsoft_crm_40_workflow_stage_example_upgraded_from_crm_30/
UPDATE: Microsoft has released a hotfix to fix the wait timer issue:
http://support.microsoft.com/?kbid=951919
Showing posts with label workflow. Show all posts
Showing posts with label workflow. Show all posts
Wednesday, June 11, 2008
Wednesday, May 2, 2007
Calling a Workflow Rule from a button
Here's a handy bit of code for calling a Workflow rule from a custom button in CRM. Put the code below into the Page_Load handler of an aspx page. In this example I call the aspx page and pass an Account record GUID (accountId) which is fed into the workflow rule.
// CRM Service Setup
CrmService service = new CrmService();
service.Credentials = System.Net.CredentialCache.DefaultCredentials;
service.Url = "http://server/mscrmservices/2006/crmservice.asmx";
// Setup the request
string accountId;
accountId = Request.QueryString["accountId"];
ExecuteWFProcessRequest request = new ExecuteWFProcessRequest();
// Triggers Workflow process
request.ProcessId = new Guid("{E4206735-0379-4DE5-A453-AC7A7DA1462B}");
request.EntityMoniker = new Moniker();
request.EntityMoniker.Id = new Guid(accountId);
request.EntityMoniker.Name = EntityName.account.ToString();
// Execute the request
ExecuteWFProcessResponse response = (ExecuteWFProcessResponse) service.Execute(request);
// CRM Service Setup
CrmService service = new CrmService();
service.Credentials = System.Net.CredentialCache.DefaultCredentials;
service.Url = "http://server/mscrmservices/2006/crmservice.asmx";
// Setup the request
string accountId;
accountId = Request.QueryString["accountId"];
ExecuteWFProcessRequest request = new ExecuteWFProcessRequest();
// Triggers Workflow process
request.ProcessId = new Guid("{E4206735-0379-4DE5-A453-AC7A7DA1462B}");
request.EntityMoniker = new Moniker();
request.EntityMoniker.Id = new Guid(accountId);
request.EntityMoniker.Name = EntityName.account.ToString();
// Execute the request
ExecuteWFProcessResponse response = (ExecuteWFProcessResponse) service.Execute(request);
Subscribe to:
Posts (Atom)