locked
Workflow times out (crm 4.0) RRS feed

  • Question

  • It's me again! Still trying to get 4.0 workflow up and running. I have the code you see below. The assembly is signed and I have registered the assembly using the registration tool from the SDK. In my test I have registered the assembly to run on the create account event. After some times it times out. If I remove the line service.Create(oAccount); it does not time out but does also not write anything back to CRM.

    Did an iisreset an CRM Asyn process restart but to no help.

     

     

     

    Code Snippet

    using System;

    using System.Collections.Generic;

    using System.Text;

    using System.Security.Principal;

    using Microsoft.Crm.Sdk;

    using MyCrmServiceDiscovery = MyFirstWorkflow.CrmDiscovery;

    using Microsoft.Crm.SdkTypeProxy;

    using CrmSdkQuery = Microsoft.Crm.Sdk.Query;

    using MyCrmService = MyFirstWorkflow.CrmSdk;

    namespace MyFirstWorkflow{

    public class Firsttry : IPlugin{

    public void Execute(IPluginExecutionContext context) {

    MyCrmService.CrmService service = InitCrmService();

    MyCrmService.account oAccount = new MyCrmService.account();

    oAccount.name = "testing workflow";

    service.Create(oAccount);

    }

    private static MyCrmService.CrmService InitCrmService(){

    MyCrmService.CrmAuthenticationToken token = new MyCrmService.CrmAuthenticationToken();

    token.OrganizationName = "LinakDevelopment2";

    MyCrmService.CrmService crmService = new MyCrmService.CrmService();

    crmService.Credentials = System.Net.CredentialCache.DefaultCredentials;

    crmService.Url = "http://localhost/MSCRMServices/2007/CrmService.asmx";

    crmService.CrmAuthenticationTokenValue = token;

    return crmService;

    }

    }

    }

     

     

    Monday, March 3, 2008 9:57 AM

Answers

  • You've got an infinite loop. Your plug-in runs when an account is created, and your code creates another account, which causes your plug-in to run, and your code creates another account, which causes your plug-in to run etc.

     

    Have a look at the following article which tells you how to avoid this - http://msdn2.microsoft.com/en-us/library/cc151077.aspx

     

    Monday, March 3, 2008 2:36 PM
    Moderator

All replies

  • You've got an infinite loop. Your plug-in runs when an account is created, and your code creates another account, which causes your plug-in to run, and your code creates another account, which causes your plug-in to run etc.

     

    Have a look at the following article which tells you how to avoid this - http://msdn2.microsoft.com/en-us/library/cc151077.aspx

     

    Monday, March 3, 2008 2:36 PM
    Moderator
  •  

    Thank you.

     

    I will now go outside and hit myself with a rock.

    Wednesday, March 5, 2008 9:09 AM