別のルックアップ フィールドの値に従ってアカウント エンティティの所有者を変更する Microsoft Dynamics CRM 4 用のプラグインを作成しています。これで、アカウントの「所有者」として機能するユーザーの GUID を取得できました。ここまでは順調ですね。所有者を変更しようとすると問題が発生します。AssignRequest を使用しようとしていますが、機能していません。リクエストを実行しようとすると、C# デバッガーで SoapException が発生し、Web サービスが次のようなダイアログを出力します。
以下は私が使用しているコードです:
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
何も見逃していないことを願っています。どんな助けでも大歓迎です:)ありがとう