MS CRM 4.0 从另一个列表中删除不活动帐户

发布于 2024-10-06 14:39:28 字数 838 浏览 2 评论 0原文

我有以下问题,我似乎找不到答案...... 我有一个 CRM 4.0 系统,我想实现以下目标:
当我有一个处于非活动状态的联系人/帐户时,可以将其从另一个列表(例如营销列表)中删除。

所以我已经拥有了一切,直到删除部分。我有一个包含非活动帐户/联系人(ID(GUID))的集合,我只需要以某种方式从列表中删除该成员。所以有一个类 RemoveMemberListRequest 看起来是正确的,唯一的问题是,不知何故我无法让它工作。

 foreach (Guid currentMember in inactiveMembers)
            {
                RemoveMemberListRequest req = new RemoveMemberListRequest();
                req.ListId = context.PrimaryEntityId;
                req.EntityId = currentMember ;
                RemoveMemberListResponse rmlResp = (RemoveMemberListResponse)crmService.Execute(req);
            }

当它尝试执行时,请求失败,并出现非常普遍的错误,即无法执行请求。我也不确定这是否是正确的方法...

还有另一个类似乎有一个可能有用的属性: QualifyMemberListRequest

具有属性:OverrideorRemove 但我不太明白这个是如何工作的,也找不到足够的信息。

有人吗?

I have the following problem, on which I can't seem to find an answer...
I have a CRM 4.0 system and I want to achieve the following:
When I have a contact/account that's inactive to remove it from another list, for example the Marketing list.

So I already have everything, up to the removing part. I have a collection with the inactive accounts/contacts (The ID's(GUID)), I just need to remove somehow the member from the list. So there is a class RemoveMemberListRequest which looks like the correct one, the only problem is, somehow I can't get it to work.

 foreach (Guid currentMember in inactiveMembers)
            {
                RemoveMemberListRequest req = new RemoveMemberListRequest();
                req.ListId = context.PrimaryEntityId;
                req.EntityId = currentMember ;
                RemoveMemberListResponse rmlResp = (RemoveMemberListResponse)crmService.Execute(req);
            }

When It tries to Execute, the request it fails, with very generic error, that it was unable to execute the request. I am also not sure if that's the correct way of doing it...

There is another class that seems to have a property that might be useful:
QualifyMemberListRequest

With property: OverrideorRemove
But I don't really understand how this one works, and I couldn't find enough information.

Anybody?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

非要怀念 2024-10-13 14:39:28

RemoveMemberListRequest 是正确的请求。

几乎所有由 CRM Web 服务请求引发的异常实际上都是 SoapException 类型,在这种情况下,它们将始终中显示“服务器无法处理请求” Message 属性,这当然不是很有帮助。

要了解有关错误的更多信息,您必须将异常视为 SoapException 并查看 Detail.InnerText 属性,该属性在大多数情况下将提供有关以下方面的有用信息:出了什么问题:

try
{
    foreach (Guid currentMember in inactiveMembers)
    {
        RemoveMemberListRequest req = new RemoveMemberListRequest();
        req.ListId = context.PrimaryEntityId;
        req.EntityId = currentMember ;
        RemoveMemberListResponse rmlResp = (RemoveMemberListResponse)crmService.Execute(req);
    }
}
catch (SoapException ex)
{
    string sExceptionDetail = ex.Detail.InnerText;

    // write sExceptionDetail somewhere you can look at it
}
catch (Exception ex)
{
    // do your normal error handling here
}

我猜你要么在某个地方捡到了一些“错误”的ID,要么是角色/权限问题。

RemoveMemberListRequest is the correct request.

Pretty much all exceptions thrown by CRM webservice requests are actually of type SoapException, and in that case they will always say "Server was unable to process request" in the Message property, which of course isn't very helpful.

To find out more about the error, you must treat the exception as a SoapException and have a look at the Detail.InnerText property, which in most cases will provide useful information about what went wrong:

try
{
    foreach (Guid currentMember in inactiveMembers)
    {
        RemoveMemberListRequest req = new RemoveMemberListRequest();
        req.ListId = context.PrimaryEntityId;
        req.EntityId = currentMember ;
        RemoveMemberListResponse rmlResp = (RemoveMemberListResponse)crmService.Execute(req);
    }
}
catch (SoapException ex)
{
    string sExceptionDetail = ex.Detail.InnerText;

    // write sExceptionDetail somewhere you can look at it
}
catch (Exception ex)
{
    // do your normal error handling here
}

I guess you either picked up some "wrong" ID somewhere, or it is a roles/privileges issue.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文