Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8305215
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T18:02:44+00:00 2026-06-08T18:02:44+00:00

I am creating a plugin for Microsoft Dynamics CRM 4 that will change the

  • 0

I am creating a plugin for Microsoft Dynamics CRM 4 that will change the owner of the account entity according to the value of another lookup field. Now I have managed to get the GUID of the user that will be acting as the ‘Owner’ of the account. So far so good.
The problem arises when I try to change the owner. I am trying to use AssignRequest but it is not working. When I try to execute the request I get a SoapException on the C# Debugger, and the webservice outputs a dialog stating:
“The requested record was not found or you do not have sufficient permissions to view it”

Below is the code I am using:

                    TargetOwnedAccount target = new TargetOwnedAccount();

                    SecurityPrincipal assignee = new SecurityPrincipal();
                    assignee.Type = SecurityPrincipalType.User;
                    assignee.PrincipalId = context.InitiatingUserId;

                    target.EntityId = ownerGuid; //this is the GUID I am retrieving from the other lookup field

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

                    AssignResponse res = (AssignResponse)crmService.Execute(assign); //this is where i get the exception

I hope I haven’t missed anything.
Any help would be much appreciated 🙂
Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T18:02:46+00:00Added an answer on June 8, 2026 at 6:02 pm

    Ok i managed to solve this finally. It had been staring directly at my face 😛
    I was entering the wrong ID’s at the wrong place. I needed to set the ‘assignee.PrincipalId’ to the ‘ownerGuid’ and then set the ‘target.EntityId’ to the current account id. The new code is as follows:

                    TargetOwnedAccount target = new TargetOwnedAccount();
    
                    SecurityPrincipal assignee = new SecurityPrincipal();
                    assignee.Type = SecurityPrincipalType.User;
                    assignee.PrincipalId = ownerGuid; //this is the GUID I am retrieving from the other lookup field
    
                    target.EntityId = ((Key)entity.Properties["accountid"]).Value;
    
                    AssignRequest assign = new AssignRequest();
                    assign.Assignee = assignee;
                    assign.Target = target;
    
                    AssignResponse res = (AssignResponse)crmService.Execute(assign);
    

    Cant believe i spent 8 hours yesterday looking at it and then today I realised immediately 😛

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In Microsoft Dynamics CRM 2011, I wrote one plug-in in C# for Account entity
When creating a plugin in Microsoft Dynamics CRM 4.0 you could use the following
I'm creating a plugin project that will have a menu and toolbar item, that
I'm creating a plugin/bookmarklet that will take an XML document embedded within the <textarea>
I'm interested in creating a plugin that does this simple task: Steps 1. User
I'm creating a jQuery plugin that needs to do a bunch of stuff the
I am creating a plugin that sends a form automatically by using PHP cURL.
Using Rails 2.3.11 , I'm creating a plugin for Redmine that add methods to
I am creating a plugin that returns a array to the template file. I
While creating a JQuery plugin that required image dimensions, I discovered that webkit browsers

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.