SAP Knowledge Base Article - Public

3075524 - OData API error : "ServiceCreateFailedException: can not get personId"

Symptom

When creating a new user profile in SuccessFactors the API returns the following error: "ServiceCreateFailedException: can not get personId.".

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 HXM Suite
    • OData API

Reproducing the Issue

1. You created a user profile in SuccessFactors by upserting the objects in the following sequence:

  • User Upsert
  • PerPerson Upsert
  • EmpEmployment Upsert
  • EmpJob Upsert
  • PerPersonal Upsert

2. The error below returned:
"ServiceCreateFailedException: can not get personId 

Cause

Previously it was recommend in the implementation documentation that a user profiles be upserted in the sequence outlined above, including an Upsert on User.

This in turn could lead to the error: "ServiceCreateFailedException: can not get personId". The issue occurred when the User Id was the same as an already existing person_id_external in the system.

Resolution

As a result of this behavior, the sequence that objects need to be created has been updated in the documentation to avoid this collision going forward:

  • The first step "User entity upsert" is unnecessary for adding a new employee, so skipping this step can prevent the error mentioned.
  • This is possible because when creating the employment record it will also create a user record.
  • The person_id_external value will be generated by the first Upsert, which will then be on PerPerson object.
  • With that in mind, the new recommended sequence is as follows:
    • At a minimum, you can insert the PerPerson, EmpEmployment, EmpJob, and PerPersonal entities to add an employee. The order in which you perform the Upsert operations is critical. Be sure to follow it: 
      1. PerPerson
      2. EmpEmployment
      3. EmpJob
      4. PerPersonal

See implementation guide for further reference: Adding a New Employee | SAP Help Portal 

In case you used the previous order (upserting User) and you are not being able to follow the new order mentioned above, please try using Check Tool to fix the error:

  1. Open Check Tool and search for "User Management" application:



  2. Run the "OrphanPersonGOs" check, it should find the user IDs which are not properly configured and should be causing the error
  3. Use the "Quick Fix" button so the user IDs get fixed
  4. After it finishes, try running the Upserts again

Keywords

can not get personId, upsert, perperson, api, adding a new employee, purge, purged, check tool, user management, OrphanPersonGOs , KBA , LOD-SF-INT-ODATA , OData API Framework , LOD-SF-INT , Integrations , LOD-SF-PLT , Platform Foundational Capabilities , Problem

Product

SAP SuccessFactors HCM Core all versions ; SAP SuccessFactors HCM suite all versions

Attachments

image.png
image.png
image.png
image.png
image.png