SAP Knowledge Base Article - Public

3592408 - 'Country/Region is a required field...' error message is displayed after upsert PerEmergencyContacts entity twice via SF Odata API

Symptom

'Country/Region is a required field...' error message is displayed after upsert PerEmergencyContacts entity twice via SF Odata API

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 HCM Suite

  • PerEmergencyContacts 

Reproducing the Issue

1. The field "custom-string1" is configured in  emergencyContactPrimary and homeAddress.

2. Upsert PerEmergencyContacts with customString1:

POST: {{URLTest}}upsert?$format=json
Payload:
{
    "__metadata": {
        "uri": "PerEmergencyContacts(name='Test1111',personIdExternal='108743',relationship='5460')",
        "type": "SFOData.PerEmergencyContacts"
    },
    "primaryFlag": "N",
    "phone": "714-455-987612",
    "customString1": "Test"
}
Response:
{
    "d": [
        {
            "key": "PerEmergencyContacts/name=Test1111,PerEmergencyContacts/personIdExternal=108743,PerEmergencyContacts/relationship=5460",
            "status": "OK",
            "editStatus": "UPSERTED",
            "message": null,
            "index": 0,
            "httpCode": 200,
            "inlineResults": null
        }
    ]
}

3. Use same payload to upsert PerEmergencyContacts again:

POST: {{URLTest}}upsert?$format=json
Payload:
{
    "__metadata": {
        "uri": "PerEmergencyContacts(name='Test1111',personIdExternal='108743',relationship='5460')",
        "type": "SFOData.PerEmergencyContacts"
    },
    "primaryFlag": "N",
    "phone": "714-455-987612",
    "customString1": "Test"
}
Response:
{
    "d": [
        {
            "key": "PerEmergencyContacts/name=Test1111,PerEmergencyContacts/personIdExternal=108743,PerEmergencyContacts/relationship=5460",
            "status": "ERROR",
            "editStatus": null,
            "message": "Country/Region is a required field and cannot be blank.\n Failed record info: {PerEmergencyContacts/primaryFlag=N, PerEmergencyContacts/phone=714-455-987612, PerEmergencyContacts/customString1=Test, PerEmergencyContacts/name=Test1111, PerEmergencyContacts/personIdExternal=108743, PerEmergencyContacts/relationship=5460}. \n  for Key PerEmergencyContacts/name=Test1111,PerEmergencyContacts/personIdExternal=108743,PerEmergencyContacts/relationship=5460 with the index 0",
            "index": 0,
            "httpCode": 500,
            "inlineResults": null
        }
    ]
}

Cause

The value from "custom-string1" is copied from emergencyContactPrimary to homeAddress, as custom-string1 of homeAddress is marked as 'cannot overwrite' status internally.

Resolution

This is a known issue currently being analyzed by the SF Engineering team.

The planned fix is still being investigated and confirmed, any progress will be updated in real time with the current KBA.

Temporary solutions: 
1. Please avoid writing customString1 field under PerEmergencyContacts entity.
2. Please avoid to send the same request twice after adding customString1 field value under PerEmergencyContacts entity.
3. If you want to upsert same record with different values, please bring all field data and use full purge. e.g. {{URLTest}}upsert?$format=json&purgeType=full 

Keywords

Country/Region is a required field and cannot be blank, PerEmergencyContacts, upsert twice, same payload but failed, ECT-252673
, KBA , LOD-SF-INT-EC , Employee Central SFAPI & OData Entities , LOD-SF-INT-ODATA , OData API Framework , Known Error

Product

SAP SuccessFactors HCM Core 2411

Attachments

Pasted image.png
Pasted image.png