locked
Setting 'Owner' attribute through a workflow RRS feed

  • Question

  • All,

    I have created a workflow that would allow me to assign, among other things, an account to a different Owner.  Every other attribute I set through the workflow is updated as expected but the Owner.

    In my Workflow Activity, I have:

    ...
    ...

    public static DependencyProperty DistrictManagerProperty = DependencyProperty.Register("DistrictManager", typeof(Lookup), typeof(SalesTerritoryActivity));

    [CrmOutput("District Manager")]
    [CrmReferenceTarget("systemuser")]
    public Lookup DistrictManager
    {
      get { return (Lookup)base.GetValue(DistrictManagerProperty); }
      set { base.SetValue(DistrictManagerProperty, value); }
    }
    ...
    ...

    In the workflow, it is pretty straight forward.  I assign the Owner the value of the 'District Manager' property.

    I have checked the rights for the (would be) Owner in the database and he has all the necessary access.

    Your help is greatly appreciated.

    Oliver
    Wednesday, February 10, 2010 12:56 AM

Answers

  • Hi Oliver!

    You cannot change owner simply by changing the attribute. As you have experienced, the owner does not change.
    Setting the attribute works only when you are creating an entity, not by updating.

    To change the owner you must execute the AssignRequest.

    Take a look at my blog post (at the bottom) to solve your problem: http://a-crm.blogspot.com/2007/05/how-to-set-or-change-owner-of-dynamic.html
    Dejan Dular

    Microsoft Certified Business Management Solutions Specialist
    • Proposed as answer by Dejan Dular Wednesday, February 10, 2010 7:54 AM
    • Marked as answer by oliver barrera Thursday, February 11, 2010 4:05 PM
    Wednesday, February 10, 2010 7:54 AM

All replies

  • Hi Oliver!

    You cannot change owner simply by changing the attribute. As you have experienced, the owner does not change.
    Setting the attribute works only when you are creating an entity, not by updating.

    To change the owner you must execute the AssignRequest.

    Take a look at my blog post (at the bottom) to solve your problem: http://a-crm.blogspot.com/2007/05/how-to-set-or-change-owner-of-dynamic.html
    Dejan Dular

    Microsoft Certified Business Management Solutions Specialist
    • Proposed as answer by Dejan Dular Wednesday, February 10, 2010 7:54 AM
    • Marked as answer by oliver barrera Thursday, February 11, 2010 4:05 PM
    Wednesday, February 10, 2010 7:54 AM
  • Dejan,

    Thanks for the response.  It worked like a charm!

    Best,

    Oliver
    Thursday, February 11, 2010 4:06 PM