我正在使用以下博客条目中的代码将用户查询重新分配给不同的用户。我已经在数据库中运行了 DB Update 语句(如下面的博客所示)。
http://mscrmblogger.com/2009/02/04/crm-4-userquery-privileges-for-system-administrators/
这是我的代码:
CrmAuthenticationToken token = new CrmAuthenticationToken();
token.AuthenticationType = AuthenticationType.AD;
token.OrganizationName = Request.Params["orgname"];
CrmService crmService = new CrmService();
crmService.Url = ConfigurationManager.AppSettings["WebServiceUrl"];
crmService.CrmAuthenticationTokenValue = token;
crmService.PreAuthenticate = true;
crmService.UseDefaultCredentials = false;
crmService.Credentials = new NetworkCredentials(username, password, domain);
SecurityPrincipal newowner = new SecurityPrincipal();
newowner.Type = SecurityPrincipalType.User;
newowner.PrincipalId = new Guid(userid);
TargetOwnedUserQuery query = new TargetOwnedUserQuery();
query.EntityId = new Guid(queryid);
AssignRequest assign = new AssignRequest();
assign.Assignee = newowner;
assign.Target = query;
AssignResponse assignResponse = (AssignResponse)crmService.Execute(assign);
运行此代码时,我在 crmService.Execute() 处得到以下异常。
SOAP Exception
Message: Server was unable to process request
Inner Detail: 0x8000404ff Cannot assign Offline Filters Platform
当为几个用户查询运行这个时,我得到了一些稍微不同的异常。大多数用户查询返回上面显示的上述/第一个异常。一些返回这些不同的 SOAP 异常。
2) Inner Detail: 0x80048448 Cannot assign address book filters Platform
3) Inner Detail: 0x80040264 Cannot assign Outlook Filters Platform
据我所知,我们的 CRM 产品没有使用离线过滤器。我们也没有使用与 Outlook 集成相关的任何内容。
自定义 ASPX 页面与我们的 CRM 托管在同一台服务器上,并且位于 ISV 文件夹中。身份验证、站点地图自定义和(似乎)所有其他部分都可以正常工作,以将其集成为自定义页面。
有关如何解决此问题的任何提示?
谢谢
查询获取 UserQueryID,@SystemUserId 通过填充的用户下拉框传入
SELECT [Name], [UserQueryId]
FROM [UserQueryBase]
WHERE [OwningUser] = @SystemUserId
ORDER BY [Name]