0
我有一個FetchXml報表在CRM Online 2013上運行,有大約12,000條記錄。數據通過腳本從CRM Online轉移到SQL數據庫。我希望當前修改的記錄只能轉移到SQL。這是我的查詢FetcXml會一直搜索前5000條記錄嗎?
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數據庫。現在的問題有兩個部分:
如何更改查詢,以便它帶來了最新修改的記錄 而在最後兩分鐘修改的一個?
二,將 提取XML總是查詢前5000個記錄?如果這個變化是 怎麼辦?可以說,在第6000條記錄中,它也會被查詢嗎?
那麼這是我的問題,它只會始終查詢第5000條記錄?如果第6000條記錄改變了怎麼辦? – hkhan
您正在按修改日期降序檢索記錄訂單。所以第一個記錄將是最後更新的記錄。 –
哦,太棒了。讓我測試一下。如果這有效,你就解決了一個巨大的問題 – hkhan