SAP Knowledge Base Article - Public

3685524 - Error when posting termination record via API

Symptom

When making an API upsert (POST) in EmpEmploymentTermination entity the following message is returned in the response:

This record was not saved because there were errors in other records for XYZ.
An error occurred while trying to execute a process related with the Job Information record with these values (start-date=YYYY-MM-DD).
<EventReason_Code> for Object eventReason is not a consistent value with the associated Object Country/Region with value <Country_Code>

Environment

  • Employee Central SFAPI & OData Entities
  • SAP SuccessFactors OData API

Reproducing the Issue

  1. Attempt to post a termination record for an employee via the API.
  2. Use the following input payload and observe the error:

```

{

"__metadata": {

"uri": "EmpEmploymentTermination"

},

"personIdExternal": "XYZ",

"userId": "XYZ",

"endDate": "/Date(1763734536832)/",

"eventReason": "<EventReason_Code>"

}

```

Note: You may experience the same or similar validation error when using the Import Employee Data to post a termination record.

Cause

A validation error is thrown by the Employee Central import engine when a termination date already exists for the employee after the date being upserted / passed in the request payload.

Resolution

  1. Identify if there is an existing future termination date for the employee.
  2. Delete the existing future termination date before attempting to upsert the new termination record.

Keywords

termination record, SAP SuccessFactors Employee Central, API error, validation error, termination date, eventReason, inconsistent value, EmpEmploymentTermination, future termination date, error when posting termination , KBA , LOD-SF-INT-EC , Employee Central SFAPI & OData Entities , LOD-SF-EC-TER , Termination Details , LOD-SF-INT-ODATA , OData API Framework , Problem

Product

SAP SuccessFactors Employee Central all versions ; SAP SuccessFactors HCM Suite all versions