Request Not Supported: AssignRequest Error (CRM 2011 Plug-in) RRS feed

  • Question

  • Hi,

    We have a Create plug-in on a custom entity that loops through a list of records and is supposed changes the ownership of those records.
    The Assign function code is shown below: 

    OrganizationRequest request = new OrganizationRequest("AssignRequest");
    "Target"] = new EntityReference(entityname, id);
    "Assignee"] = new EntityReference("systemuser", systemuserid);
    OrganizationResponse response = (OrganizationResponse)service.Execute(request);

    We are receiving a "Request not Supported: AssignRequest" error on the Execute Method line.
    The user that is executing this plugin has System Administrator rights, so there is no priviledge issues.

    Let me know if you have any suggestions.


    Friday, July 22, 2011 11:29 PM


  • Hi,

    You need to use AssignRequest for assigning the record to the system user, your code should be like this:

    AssignRequest jj_AssignRequest = new AssignRequest();
    AssignResponse jj_AssignResponse = null;
    jj_AssignRequest.Assignee = new EntityReference("systemuser", systemuserid);
    jj_AssignRequest.Target = new EntityReference(entityname, id);
    jj_AssignResponse = (AssignResponse)service.Execute(jj_AssignRequest);

    Jehanzeb Javeed

    Linked-In Profile |CodePlex Profile

    If you find this post helpful then please "Vote as Helpful" and "Mark As Answer".
    • Proposed as answer by Jehanzeb.Javeed Saturday, July 23, 2011 8:09 AM
    • Marked as answer by Aric Levin Sunday, July 24, 2011 6:02 AM
    Saturday, July 23, 2011 8:09 AM