locked
This workflow job was canceled because the workflow that started it included an infinite loop. Correct the workflow logic and try again. For information about workflow logic RRS feed

  • Question

  • Hi ,private

    void UpdatePatientProfileStatusToOutofManagment(IPluginExecutionContext context, string parentkey)

    {

    ICrmService crmservice = context.CreateCrmService(

    true);

    DynamicEntity dyntreat =

    new DynamicEntity();

    dyntreat.Name =

    "opportunity";

    Microsoft.Crm.Sdk.PropertyCollection properties =

    new Microsoft.Crm.Sdk.PropertyCollection();

    Status PPstatus =

    new Status(int.Parse("200013"));

    Guid entityguid =

    new Guid(parentkey);

    properties.Add(

    new KeyProperty("opportunityid", new Key(entityguid)));

    properties.Add(

    new StatusProperty("statuscode", PPstatus));

    dyntreat.Properties = properties;

    TargetUpdateDynamic target =

    new TargetUpdateDynamic();

    target.Entity = dyntreat;

    UpdateRequest update =

    new UpdateRequest();

    update.Target = target;

    UpdateResponse updated = (UpdateResponse)crmservice.Execute(update);

    }

    Tuesday, June 5, 2012 12:49 PM

All replies

  • Hi,

    It looks likely that you have a plugin or workflow that is triggering it's self repeatedly by performing the same update that it was triggered by in the first place.

    Scott


    Scott Durow
    Read my blog: www.develop1.net/public
    If this post answers your question, please click "Mark As Answer" on the post and "Mark as Helpful"

    Wednesday, June 6, 2012 7:17 AM
    Answerer
  • please let me know the solution for this...

    Thanks for you help..

    Friday, June 8, 2012 9:16 AM
  • You need to look for any circular references where a plugin/workflow is registered to start on an update, but they also perform an update them selves.

    Scott Durow
    Read my blog: www.develop1.net/public
    If this post answers your question, please click "Mark As Answer" on the post and "Mark as Helpful"

    Friday, June 8, 2012 6:19 PM
    Answerer