Search code examples
dynamics-crmcrmdynamics-crm-2016

CRM 2016 Version stamp associated with the client has expired


With CRM 2016, I use RetrieveEntityChangesRequest to get changed data from CRM:

var request = new RetrieveEntityChangesRequest
        {
            EntityName = entityLogicalName,
            DataVersion = dataToken,
            Columns = columnSet,
            PageInfo = new PagingInfo { Count = Constants.DefaultCRMChunkSize, PageNumber = 1, ReturnTotalRecordCount = false }
        };

It worked for me before, but today after a period of time I have not run, it's suddently throw an exception: System.ServiceModel.FaultException`1[Microsoft.Xrm.Sdk.OrganizationServiceFault]: Version stamp associated with the client has expired. Please perform a full sync. (Fault Detail is equal to Microsoft.Xrm.Sdk.OrganizationServiceFault).

In my case the dataToken is empty, as I want to get all data for the first time.

Any idea about the problem? And please tell me how to solve it. Thank you.


Solution

  • As described in this article https://msdn.microsoft.com/en-us/library/jj863599.aspx, the problem can caused by putting empty of datatoken to the RetrieveEntityChangesRequest, instead, you should pass null value and retreive the latest token from the response.