Symptom
- You wish to know the correct upsert sequence for adding a concurrent employment to an existing employee;
- Or you're following the upsert sequence illustrated in https://blogs.sap.com/2015/03/23/how-to-create-an-employee-using-odata-apis/, but it results in error.
Environment
- SAP SuccessFactors HXM Suite
- EC OData API
Cause
The correct entity upsert sequence when creating a concurrent employment is different from the one used to create a brand new employee.
Resolution
Please refer to this page: Importing Concurrent Employments for Employees. It talks about how to create concurrent employments using the CSV import tool, but OData API uses the import engine as well so in general the same principles applied to CSV import are also valid when upserting via OData API.
So in short, the upsert sequence to create a secondary employment for an existing employee is as follows:
- Upsert EmpEmployment with the user's existing person id external and a new userId (non-existing).
- Upsert EmpJob and other entities as needed.
A new User record should NOT be upserted when creating the secondary employment. You should start with the EmpEmployment entity as stated above, and the system will automatically create a new User record because you provided a new user ID.
Keywords
concurrent, employee, employment, odata, upsert, api, insert, create, add, fails, failing, call, request, failed, unsuccessful, not, able, unable, creation, creating, working, integration, flow, interface , KBA , LOD-SF-INT-EC , Employee Central SFAPI & OData Entities , LOD-SF-INT , Integrations , LOD-SF-INT-ODATA , OData API Framework , How To