SAP Knowledge Base Article - Public

2477558 - How to work with SFOdata.Background_InsideWorkExperience Entity

Symptom

While performing various CRUD operations on the SFOdata.Background_InsideWorkExperience Entity, you are getting below error messages:

  • Error "For input string: \"\"", when passing blank value for the backgroundElementId field
  • Error message: "Single-valued key cannot be represented as a complex value" when not passing the field backgroundElementId in the Upsert operation
  • Error message: "Employee XXXXXX has no Edit access to record 123404. with the index 0" when passing a random value for the field backgroundElementId in the Upsert operation

Environment

Successfactors

Cause

The reason for these errors is incorrect request data sent to the SFSF system.

Resolution

In order to resolve the issue, you need to ensure you pass the REQUEST in correct format.
This KBA explains how to perform various CRUD operations on the SFOdata.Background_InsideWorkExperience Entity

   Sample request for Query operation-

GET /odata/v2/Background_InsideWorkExperience?$filter=userId eq 'admin'&$format=json

   Sample request for Insert operation-

POST /odata/v2/ Background_InsideWorkExperience?

{
"usersId" : "MultJob1",
"testDate" : null,
"startDate" : "\/Date(1388563200000)\/",
"title" : "test12",
"testVarchar" : "[test4][http://www.example.com]",
"endDate" : "\/Date(1388563200000)\/",
"testInteger" : 0,
"testFloat" : null,
"division":"240", //division is configured as a picklist,insert the picklist option Id
}

   Sample request for Upsert operation to Insert a new record-

POST /odata/v2/upsert?
{
"__metadata":{"uri":" Background_InsideWorkExperience "},
" backgroundElementId " :0,// backgroundElementId=0 means this is the insert operation
"usersId" : "MultJob1",
“bgOrderPos”:-1, //Here set the bgOrderPos<0
"testDate" : null,
"startDate" : "\/Date(1388563200000)\/",
"title" : "test12",
"testVarchar" : "[test4][http://www.baidu.com]",
"endDate" : "\/Date(1388563200000)\/",
"testInteger" : 0,
"testFloat" : null,
"division":"240", //division is configured as a picklist,insert the picklist option Id
}

   Sample request for Upsert operation to Update a new record-

POST /odata/v2/upsert?
{
"__metadata":{"uri":" Background_InsideWorkExperience "},
" backgroundElementId " :234,// backgroundElementId!=0 means this is the update operation, the id “234” is the original ID
"usersId" : "MultJob1",
“bgOrderPos”:10, // bgOrderPos=10, original bgOrderPos
"testDate" : null,
"startDate" : "\/Date(1388563200000)\/",
"title" : "test12",
"testVarchar" : "[test4][http://www.baidu.com]",
"endDate" : "\/Date(1388563200000)\/",
"testInteger" : 0,
"testFloat" : null,
"division":"240",
}

   Sample request for Delete operation-

DELETE /odata/v2/ Background_InsideWorkExperience (backgroundElementId =2807L,userId='admin')?$format=json

Points to Note:

1. While Inserting a new record using the 'Upsert' operation, you should pass the field 'backgroundElementId' in the request with a value '0'.
2. But when updating an existing Background-element using the 'Upsert' operation, you need to pass the existing value of the 'backgroundElementId' field.

Keywords

  • Error "For input string: \"\"", when passing blank value for the backgroundElementId field
  • Error message: "Single-valued key cannot be represented as a complex value" when not passing the field backgroundElementId in the Upsert operation
  • Error message: "Employee XXXXXX has no Edit access to record 123404. with the index 0" when passing a random value for the field backgroundElementId in the Upsert operation
, KBA , LOD-SF-INT-API , SF API & Adhoc API Framework , LOD-SF-INT , SF Integrations - EC Payroll, Boomi/ HCI, API , LOD-SF-INT-ODATA , OData API Framework , Problem

Product

SAP SuccessFactors HCM Core 1702 ; SAP SuccessFactors HCM Suite all versions