English 中文(简体)
检索CRM2011营销列表实体ID
原标题:Retrieve EntityID for MarketingList in CRM2011

我敢肯定有人可以帮我解开这里的麻烦,我非常喜欢撕裂我的头发,为什么下面的代码不起作用。基本上,我有一个定制实体wich和我的定制实体(在创建后注册的)有一份名单(及其名单上的所有成员),我创造了另一个名单,将所有这些名单成员都导入到另一个名单中。现在我需要为每个名单成员检索实体ID(以便我添加它们 ) 我下面的代码(仅供一位名单成员测试):

// GET LIST MEMBER 
QueryByAttribute query = new QueryByAttribute("listmember");
query.AddAttributeValue("listid", m_list_ID.Id);
ColumnSet cs = new ColumnSet();
cs.AddColumns("entityid");
query.ColumnSet = cs;
EntityCollection entityCollection = service.RetrieveMultiple(query);


Guid g = Guid.Empty;
g = (Guid)entityCollection.Entities[0].Attributes["entityid"];

要检查在另一个字段上输入 GUID 的线索, 我只需检查它是否正确, 但当我试图保存表格时, 我就会发现错误 : “ 系统 。 InvalidCastException: 指定的投影无效 : 指定的投影无效 ” 。 在另一个注释上, 我确定它会像我计算的那样检索实体, 它会显示正确的实体数目, 但出于某种原因不允许我抓取实体Id 属性 。 如果索莫能解释这里发生的情况, 请多谢 。

最佳回答

listist member 实体的 entityid 属性为类型 EnityReference 。如果将投影修改为 EntyReference , 您可以通过 Id 属性引用 GUID 。

问题回答

暂无回答




相关问题
jQuery - ScrollTo and Serial Scroll not working together

I have tested the scrollTo() plugin, but I need a way to stop the scrolling animation, so I am looking at serialScroll(). Here is what I used with scrollTo: $( #scroller ).scrollTo( 1000px , 3000); ...

jQuery deconstructors for plugins?

I m using the Galleria plugin inside an Accordion plugin to display images in a super cool way. A problem occurs, however, when I open up a new tab (in the accordion) then come back to the gallery tab....

XPCOM Security issues

I m developing a Firefox plugin using XPCOM, I ve not yet read all the docs, but as far as I can see, A plugin is simply a DLL that provides services via a XPCOM interface and interacts with the ...

Ruby on Rails plugin development process

I m considering developing aspects of a website as Rails plugins for reuse. My question is about the development process. Since each of these plugins will provide a "slice" of functionality, should ...

help mongrel wont start

I have decided to switch from Restful authentication to authlogic.. so what I did was delete every file and folder that got installed when I downloaded the plugin.. now when I try to "ruby script/...

Basic MEF workflow/usage

I m looking to a framework which will allow me to have a simple plugin system in my .NET application. It seems MEF is the framework which Microsoft is endorsing, and will become part of .NET 4 (it ...

RubyCAS-Client question: Rails

I ve installed RubyCAS-Client version 2.1.0 as a plugin within a rails app. It s working, but I d like to remove the ?ticket= in the url. Is this possible?

java plugin cache and dynamic IP host

I m trying to use Amazon S3 and Amazon Cloudfront CDN to deliver the jar files of my applet application. I m seeing several cache misses of my jars by the java plugin. This is a show-stopper for me, ...

热门标签