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.
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.htmlDejan Dular
Microsoft Certified Business Management Solutions Specialist
Proposed as answer byDejan DularWednesday, February 10, 2010 7:54 AM
Marked as answer byoliver barreraThursday, February 11, 2010 4:05 PM
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.htmlDejan Dular
Microsoft Certified Business Management Solutions Specialist
Proposed as answer byDejan DularWednesday, February 10, 2010 7:54 AM
Marked as answer byoliver barreraThursday, February 11, 2010 4:05 PM