crm 4.0 how to update RRS feed

  • Question

  • Hi all

    We have upgraded from crm 3.0 to 4.0

    Now we have a problem when we update a case with the crm web service all the information is updated except the ownerid but if we do the update through the crm directly all the information is updated including the ownerid

    Any suggestion  

    Wednesday, June 11, 2008 8:22 AM

All replies

  • Hi Ziv,

    We had this same issue recently. We found that ownerid of any entity is a "Special" field that needs to be updated separately. Us the code below as an example. Place this code after you have completed your UpdateRequest().

    Be aware that this code can interrupt workflows that may be related to the ownerid field.

    Code Snippet

    //Where owneridGuid = "Guid of SystemUser"assign.Target = targetAssign;

    // And entityGuid = "Guid of Entity you wish to update field on"

    SecurityPrincipal assignee = new SecurityPrincipal();
    assignee.PrincipalId = new Guid(owneridGuid);

    TargetOwnedDynamic targetAssign = new TargetOwnedDynamic();
    targetAssign.EntityId = new Guid(entityGuid);
    targetAssign.EntityName = EntityName.incident.ToString();

    AssignRequest assign = new AssignRequest();
    assign.Assignee = assignee;

    AssignResponse assignResponse = (AssignResponse)service.Execute(assign);

    Hope this helps,
    • Proposed as answer by Tomas Breen Wednesday, February 4, 2009 11:01 AM
    Thursday, November 13, 2008 2:33 PM