SAP Knowledge Base Article - Public

2822255 - Error "Property manager is a navigation property, the given value should be an object" occurred with ODATA API Upsert call

Symptom

Error "Property manager is a navigation property, the given value should be an object" occurred when update User entity's property "Manager" with ODATA API Upsert Call.

Environment

SuccessFactors BizX

Reproducing the Issue

1. Process ODATA API Upsert call like below for example:

“{
"__metadata" : {
"uri": "User('123')"
},
"userId": "123",
"businessPhone": "1234566",
"empId": "123",
"timeZone":"Asia\/Shanghai"… …
"hireDate": "/Date(694224000000)/",
"manager": "223"
}”

2. Below error occurred:

{ "d": [ { "key": null, "status": "ERROR", ..."message": "Property manager is a navigation property, the given value should be an object", "index": 0, "httpCode": 400, "inlineResults": null } ] }

Cause

Property manager has type: User, it is an object rather than a string. This can be checked from OData API Data Dictionary.
2019-08-01_KBA01.png

Resolution

Please refer SAP SuccessFactors HCM Suite OData API: Developer Guide
https://help.sap.com/doc/a7c08a422cc14e1eaaffee83610a981d/latest/en-US/SF_HCM_OData_API_DEV.pdf
Chapter: Upsert Operation
In which has an example request to update manager property as below:

"manager": {
"__metadata": {
"uri": "User('OldManager')"
}
}

Please refer to this example and re-configure the ODATA API Upsert call accordingly.

Keywords

ODATA API; User; Manager; navigation property; object , KBA , LOD-SF-INT-ODATA , OData API Framework , Problem

Product

SAP SuccessFactors HCM Core all versions