1
votes

(Sorry for bad English) I have an application that uses MS-CRM 2011 Web Service for retrieving last changes on crm Entities. This application Sync last data changes with a Windows Mobile device. Sync operation occurs periodic every 20 minutes. In each sync operation I want to retrieve changes occurred from previous update by checking entities 'modifiedon' field. Problem is that, CRM queries don't use Time piece of DateTime object and all change from the start of passed DateTime parameter been returned.

I'd check both FetchXML and QueryExpression, there is no different. Is there any way to create a query for run on Crm WebService that return modified record from specified Date and time?

Sample (My FetchXml) :

<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false'>
<entity name='new_brand'>
<attribute name='new_brandname' />
<attribute name='new_pdanumber' />
<filter type='and'>
<condition attribute='modifiedon' operator='on-or-after' value='2012/11/12 23:59'/>
</filter>
</entity>
</fetch>

See In the code, I wants all modified entities from 2012/11/12 23:00, but crm returns all modified record from 2012/11/12 00:00.

3

3 Answers

0
votes

Your code is looking for records changed on or after 23:59... Your documented results sound correct.

In any case, the time part is used but i suspect you are seeing the result of user time versus universal time. If the users time zone offset != 0 then midnight as selected by the user in the UI will be different to the value stored in the database which is the UST equivalent.

0
votes

I have the same problem now with and oldest Dynamics CRM 2011 organization.The on or after comparation don't compare the time, only the date. Try using grater or equal ('ge' in fetchxml).

0
votes

We've added a new field (called ModifiedOnTick) to the Entity, and record the time difference in milliseconds with a fixed date (2011-01-01) in this field.