SAP Knowledge Base Article - Public

2850236 - PerPhone Odata Upsert error: Only one record can be set as primary record

Symptom

I'm upserting PerPhone via OData API and I'm getting error below:

Only one record can be set as primary record for XXXX

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

Environment

Successfactors / Employee Central / OData API

Reproducing the Issue

  1. I currently have data in UI showing as below:

dataUIKBA.png

 2. My request payload below is saying that I would like to change the current isPrimary of phonetype 10606 from 'true' to false

{
"__metadata": {
"uri": "https://apisalesdemo4./odata/v2/PerPhone(phoneType='10606',personIdExternal='109031')",
"type": "SFOData.PerPhone"
},
"areaCode": "123",
"isPrimary": false,
"phoneNumber": "21432122"
}

3. And the response was:

<d:message>Only one record can be set as primary record for XXXX.
Failed record info: {PerPhone/areaCode=XX, PerPhone/isPrimary=false, PerPhone/phoneNumber=XX, PerPhone/personIdExternal=XX, PerPhone/phoneType=XX}.
for Key PerPhone/personIdExternal=XX,PerPhone/phoneType=XXXwith the index 0</d:message>

I've also tried to update this via UI but got the same error:

perphoneUIupdate.png

Cause

 This is expected behavior. There should be one active Primary phone information.

Resolution

  • In your request payload, include both current records. and change the value of is primary for both phonetypes. See example below:

Current data:
phoneType='10604'
"isPrimary": false,

Value to in your request payload:

phoneType='10604'
"isPrimary": true

Current data:
phoneType='10606'
"isPrimary": true,

Value to in your request payload:

phoneType='10604'
"isPrimary": false

  • In SuccessFactors Import Data page, you can do the same. See sample screenshot of excel file below:

sampleimportUIKBA.PNG

See Also

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

2855996 - What value to use when upserting via OData API or Import Employee data of a picklist field?

2799250 - Odata API Upsert Picklists with same label behavior

Keywords

Only one record can be set as primary record for user XXXX, PerPhone , KBA , LOD-SF-INT-INC , Integration Center , Problem

Product

SAP SuccessFactors HCM Core 1908