SAP Knowledge Base Article - Public

2336568 - Error message 'Only one record can be set as primary record for XXXXX' for OData API entity PerEmail Upsert operation

Symptom

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

Trying to perform Upsert operation on SFOData.PerEmail entity and getting below error message:

PerEmailEntityUpsertError.jpg

Environment

SAP SuccessFactors HXM Suite

SuccessFactors OData Entities 

Cause

Expected System behavior

Resolution

This is an expected system behavior and that is- We cannot use the same emailType to capture more than one email information irrespective of 'Primary' or 'non Primary' email id. We need to use separate email type for this.

So in order to confirm whether there is already an email entered for the same emailType as in the 'Upsert' request, you can query as follows and verify the result-

https://<api-server>/odata/v2/PerEmail?$select=personIdExternal,emailType,emailAddress,isPrimary&$filter=personIdExternal eq <personIdExternal> &$format=json

****<personIdExternal> in the above query should be the one from the failed upsert request.

Keywords

PerEmail, OData API, Upsert operation, emailType, primary email, non-primary email, error message, SuccessFactors, API, query, system behavior, email address, failed request, PerEmail entity  , KBA , ss_anonymizedkba , LOD-SF-INT-ODATA , OData API Framework , LOD-SF-INT , Integrations , Problem

Product

SAP SuccessFactors HCM Core 2511