问题描述
我创建了一个提取XML,该XML为我提供了营销列表中的所有联系人。我也想将列表的名称放入输出中。我找到了两种方法来实现这一目标,而学徒们都不满意。
I've created a fetch XML that gives me all the contacts in a marketing list. I also would like to get the name of the list baked into the output. I've found two ways to achieve that, none of which is satisfactory to the pedantic me.
- 转到数据库并获取名称作为单独的请求。
- 有一个额外的列,包含每个联系人的营销列表名称。
我将从CRM中获得多个(甚至可能是所有)营销列表,因此第二个版本似乎最合适,因为我将打一个电话并将其全部放入一个我将要使用的数据结构中(DataSet和这样很有趣)。问题在于我们有很多冗余。我该如何解决?
I'll be getting multiple (maybe even all) marketing lists from CRM so the second version seems most suitable as I'll make one call and get it all into a data structure that I'll play with (DataSet and such are fun). The problem is there that we're getting a lot of redundancy. How can I resolve that?
推荐答案
您是否可以将营销列表名称添加到提取中?
Are you able to add the marketing list name into the fetch?
例如:
查询:
<fetch mapping="logical" count="50" version="1.0">
<entity name="list">
<attribute name="listname" />
<link-entity name="listmember" from="listid" to="listid">
<link-entity name="contact" from="contactid" to="entityid">
<attribute name="fullname" />
</link-entity>
</link-entity>
</entity>
</fetch>
结果:
<resultset morerecords="0" paging-cookie="<cookie page="1"><listid last="{4EDF9ECA-A108-E211-801E-00155D505002}" first="{4EDF9ECA-A108-E211-801E-00155D505002}" /></cookie>">
<result>
<listname>Test Marketing List Name</listname>
<listid>{4EDF9ECA-A108-E211-801E-00155D505002}</listid>
<entityid.fullname>James Maths Wood</entityid.fullname>
</result>
<result>
<listname>Test Marketing List Name</listname>
<listid>{4EDF9ECA-A108-E211-801E-00155D505002}</listid>
<entityid.fullname>James Wood</entityid.fullname>
</result>
<result>
<listname>Test Marketing List Name</listname>
<listid>{4EDF9ECA-A108-E211-801E-00155D505002}</listid>
<entityid.fullname>WoodJ Test</entityid.fullname>
</result>
</resultset>
从侧面看,您可以从,适用于Crm 4,但几乎可以处理我需要创建的每个2011年抓取操作。注意:它没有为上面的营销列表正确创建访存,我不得不将链接实体更改为手动将contact更改为contactid。
As a side have you seen the FetchXml builder included in the Stunnware Tools available from http://www.stunnware.com, its for Crm 4 but handles pretty much every 2011 fetch I've needed to create. Note: it didnt create the fetch for the marketing list above correctly, I had to change the link-entity to contact to contactid manually.
这篇关于从CRM Dynamics中获取不规则数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!