【发布时间】:2014-08-31 23:02:40
【问题描述】:
我有一个在 CRM Online 2013 上运行的 FetchXml 报告,其中包含大约 12,000 条记录。数据通过脚本从 CRM Online 转移到 SQL 数据库。我希望将当前修改的记录仅转移到 SQL。这是我的查询
string fetchXml = string.Format(
@"<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false'>
<entity name='new_studentinformation' enableprefiltering ='1' prefilterparametername='CRM_Filterednew_studentinformation'>
<attribute name='new_studentid' />
<attribute name='new_primaryhomeroom' />
<attribute name='new_lastname' />
<attribute name='new_firstname' />
<attribute name='new_busnumber' />
<attribute name='new_building' />
<attribute name='new_grade' />
<attribute name='modifiedon' />
<attribute name='new_studentinformationid' />
<filter type='and'>
<condition attribute='modifiedon' value='{0}' operator='on-or-after'/>
</filter>
<link-entity name='annotation' from='objectid' to='new_studentinformationid' alias='Notes' link-type='outer'>
<attribute name='documentbody'/>
</link-entity>
</entity>
</fetch>",
DateTime.Now.AddMinutes(-2).ToString());
这会查询最近两分钟内修改的记录并将其转移到 SQL 数据库。问题分为两部分:
如何更改查询以便它带来最新的修改记录 而不是最后两分钟修改的那个?
第二,将 Fetch XML 总是查询前 5,000 条记录?如果改变是什么 比方说,在第 6000 条记录时,它也会被查询吗?
【问题讨论】:
标签: sql crm bids dynamics-crm-online fetchxml