SAP Knowledge Base Article - Public

2203238 - Employee central OData API fetches incorrect data for the filter "lastModifiedDateTime"

Symptom

You are fetching data of employees whose records are modified later than a specific date. However, EC OData API returns user records older than the specified date.

NOTE: Image/data in this KBA is from SAP internal systems, sample data, or demo systems. Any resemblance to real data is purely coincidental.

Environment

  • SAP SuccessFactors HXM Suite
    • OData API

Reproducing the Issue

OData Request
https://salesdemo4.successfactors.com/odata/v2/EmpJob?$select=lastModifiedDateTime&$filter=lastModifiedDateTime ge datetime'2015-07-01T17:19:28'&$top=1

OData Response

<id>
https://salesdemo4.successfactors.com:443/odata/v2/EmpJob(seqNumber=1L,startDate=datetime'2003-01-01T00:00:00',userId='12345')
</id>
<title type="text" />
<updated>
2015-08-09T09:48:36Z
</updated>
<author>
<name />
</author>
<link rel="edit" title="EmpJob" href="EmpJob(seqNumber=1L,startDate=datetime'2003-01-01T00:00:00',userId='12345')" />
<category term="SFOData.EmpJob" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
<content type="application/xml">
<m:properties>
<d:lastModifiedDateTime m:type="Edm.DateTimeOffset">
2011-10-11T21:44:57Z
</d:lastModifiedDateTime>
</m:properties>
</content>

From the request, we expect that the lastModifiedDateTime is returned for datetime changes made after '2015-07-01T17:19:28'

However, from the response, we observe that API has fetched a record that dates to '2011-10-11T21:44:57Z'.

Resolution

If you use condition lastModifiedDateTime ge datetime'2015-07-01T17:19:28', any EC API will return not only the data which lastModifiedDateTime is greater than 2015-07-01T17:19:28, but also the record related to deleted records.

More explanation with respect to the above Odata response.
For the above userId "12345", there would be atleast one record which is deleted after the datetime 2015-07-01T17:19:28. Hence the API is returning this user's record for the above request xml.

Best Practice
Therefore, whenever you encounter such results, please check your data in SuccessFactors first.

See Also

If you are trying to delete a timeslice for an employee, make sure that the employee is left with at least one or more timeslices.

If all the records are deleted, the API would not pick their data in the response.

Keywords

lastModifiedDateTime, cannot, can't, not, working, able, successful, unsuccessful, unable, failed, failing, fails, error, issue, message, throws, throwing, returning, returns, rejecting, rejects, problem, wrong, SF, successfactor, request, integration, call, query, get, payload, response , KBA , old records returned , lastmodifieddatetime issue , LOD-SF-INT , Integrations , Problem

Product

SAP SuccessFactors HXM Suite all versions