SAP Knowledge Base Article - Public

2906479 - convertAssignmentIdExternal failing with java.lang.Integer cannot be cast to java.lang.String

Symptom

API Call convertAssignmentIdExternal failing with java.lang.Integer cannot be cast to java.lang.String

Environment

 SAP SuccessFactors HXM Suite

Reproducing the Issue

In this example we will be using Postman to do API call.

Testing 1:Request payload:

https://apisalesdemo4.successfactors.com/odata/v2/convertAssignmentIdExternal?oldAssignmentIdExternal=britney&newAssignmentIdExternal=test1234

  • Response Payload

{
"d": {
"convertAssignmentIdExternal": "test123"
}
}

Testing 2:Request payload:

https://apisalesdemo4.successfactors.com/odata/v2/convertAssignmentIdExternal?oldAssignmentIdExternal=jonsnow&newAssignmentIdExternal=1234&$format=json

  • Response payload:

"error": {
"code": "ServerErrorException",
"message": {
"lang": "en-US",
"value": "java.lang.Integer cannot be cast to java.lang.String"

Cause

The values for AssignmentIdExternal could not be pure numeric values or values that start with numbers in the API request query, but with single quote will always work.

Resolution

If value starts with numeric, use single quote.

See Also

2825052 - Assignment ID

https://help.sap.com/viewer/28bc3c8e3f214ab487ec51b1b8709adc/1911/en-US/a5ec199c09944dfb9197b832c1e88bd3.html?q=convertAssignmentIdExternal

Keywords

convertAssignmentIdExternal ServerErrorException, java.lang.Integer cannot be cast to java.lang.String , KBA , LOD-SF-INT , Integrations , LOD-SF-INT-ODATA , OData API Framework , Problem

Product

SAP SuccessFactors HCM Suite all versions