SAP Knowledge Base Article - Public

3292119 - Unable to upsert an inctive userId to a custom field with "Employee" type.

Symptom

We cannot upsert an inactive userId to a custom field with "Employee" type. Response code is 500 and the error message is: "TestUser is invalid..."

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

  • Employee Central Odata API entity

Reproducing the Issue

1. customString1 is a custom field with "Employee" type under personalInfo configuration page.

2. Upsert the field customString1 with invalid userId:

POST: https://apisalesdemo8.successfactors.com/odata/v2/upsert?$format=json 

Payload:

{
    "__metadata": {
        "uri": "PerPersonal"
    },
    "personIdExternal": "108743",
    "customString1": "108743-Test",
    "maritalStatus": "10820",
    "startDate": "/Date(1661323086000)/"
}

Response:

{
    "d": [
        {
            "key": "PerPersonal/personIdExternal=108743,PerPersonal/startDate=2022-08-24T06:38:06.000-04:00",
            "status": "ERROR",
            "editStatus": null,
            "message": "TestUser is invalid.\n Failed record info: {PerPersonal/personIdExternal=108743, PerPersonal/customString1=108743-Test, PerPersonal/maritalStatus=10820, PerPersonal/startDate=2022-08-24T06:38:06.000-04:00}. \n  for Key PerPersonal/personIdExternal=108743,PerPersonal/startDate=2022-08-24T06:38:06.000-04:00 with the index 0",
            "index": 0,
            "httpCode": 500,
            "inlineResults": null
        }
    ]
}

Cause

EC Odata API will verify user status if "Employee" type is associated with a custom field.

Resolution

It is an expected behavior. 

You can change this User field to non-required, and skip this field value. Or please use valid userId.

e.g.

POST: https://apisalesdemo8.successfactors.com/odata/v2/upsert?$format=json 

Payload:

{
    "__metadata": {
        "uri": "PerPersonal"
    },
    "personIdExternal": "108743",
    "customString1": "sfadmin",
    "maritalStatus": "10820",
    "startDate": "/Date(1661323086000)/"
}

Response:

{
    "d": [
        {
            "key": "PerPersonal/personIdExternal=108743,PerPersonal/startDate=2022-08-24T06:38:06.000-04:00",
            "status": "OK",
            "editStatus": "UPSERTED",
            "message": null,
            "index": 0,
            "httpCode": 200,
            "inlineResults": null
        }
    ]
}

Keywords

customStringX is invalid, 500, Failed record info, error , KBA , LOD-SF-INT-EC , Employee Central SFAPI & OData Entities , Problem

Product

SAP SuccessFactors HXM Core 2211