Symptom
You are upserting data to the PerPersonRelationship entity / object and receive the below error:
-
Properties firstName, lastName are not upsertable. Please check the property setting in Admin Center > OData API Data Dictionary or the entity metadata.
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
- Employee Central OData API
Reproducing the Issue
- Send POST request like below:
POST: https://apiX.successfactors.com/odata/v2/upsert?{"personIdExternal": "employee123","relatedPersonIdExternal": "dependent_d123","startDate": "/Date(1670457600000)/","relationshipType": "11603","firstName": "dependent_firstName","lastName": "dependent_lastName","__metadata": {"type": "SFOData.PerPersonRelationship","uri": "PerPersonRelationship"}} - Receive the below error in the API response:
"Properties firstName, lastName are not upsertable. Please check the property setting in Admin Center > OData API Data Dictionary or the entity metadata."
Cause
The firstName & lastName values of the dependent are stored in the PerPersonal (Personal Information) entity, as they are considered personal information
Resolution
The firstName & lastName values will be retrieved from PerPersonal (Personal Information) based on the relatedPersonIdExternal value provided in the request payload
These values do not need to be included in the upsert request to PerPersonRelationship:
- POST: https://apiX.successfactors.com/odata/v2/upsert?
{"personIdExternal": "employee123","relatedPersonIdExternal": "dependent_d123","startDate": "/Date(1670457600000)/","relationshipType": "11603","__metadata": {"type": "SFOData.PerPersonRelationship","uri": "PerPersonRelationship"}}
When the PerPersonRelationship record is read back after creation, you will see the firstName & lastName populated with the same values as stored in the PerPersonal entity / object
Keywords
KBA , LOD-SF-INT-EC , Employee Central SFAPI & OData Entities , LOD-SF-INT-ODATA , OData API Framework , Problem