Symptom
Query of SFOData.PerEmergencyContacts using primaryFlag='Y' filter returns record whose primaryFlag is set N.
The response is suspected to be incorrect/inconsistent.
Image/data in this SeeKBA is from SAP internal systems, sample data, or demo systems. Any resemblance to real data is purely coincidental.
Sample Case :
1. Query : use filter > primaryFlag eq 'Y'
https://<API_URL>/odata/v2/PerEmergencyContacts?$select=name,personIdExternal,relationship,createdBy,createdDateTime,createdOn,lastModifiedBy,lastModifiedDateTime,lastModifiedOn,phone,primaryFlag,personNav/personIdExternal,relationshipNav/id&$expand=personNav,relationshipNav&$filter=primaryFlag eq 'Y'&$format=json
2. Response :
Environment
SAP Successfactors HXM Suite
Reproducing the Issue
1. Query SFOData.PerEmergencyContacts with filter primaryFlag = 'Y'
2. Response shows record not respecting the filter selection
Cause
SFOData.PerEmergencyContacts / PerEmergencyContacts entity has below business keys.
The records with primaryFlag=N in the sample is read due to the data record of the Emergency Contact for both the primary record set to 'Y' has the same business key relationship + Name + personIdExternal.
Note that since the business keys, in this sample the data record above is considered a duplicate or inconsistent data.
Resolution
1. Review the validity of use case of having an Emergency contact with same Relationship and Name.
2. The correct use of having a second number for an Emergency Contact is to use the property 'secondPhone' for adding alternative phone number to the same contact (same name and relationship)
See below field.
Moving forward Employee Central Engineer for API will plan to enhance business key validation for future consideration in SF Employee Profile UI. In order to prevent this data entry of multiple records having same business key.
See Also
Keywords
SFOData.PerEmergencyContacts, PerEmergencyContacts , primaryFlag, business key, secondPhone, inconsistent filter primaryFlag , KBA , LOD-SF-INT-EC , Employee Central SFAPI & OData Entities , LOD-SF-INT , Integrations , LOD-SF-INT-ODATA , OData API Framework , Problem