SAP Knowledge Base Article - Public

2248190 - SFAPI Insert Error - Invalid enum value for Job Application

Symptom

You are trying to create a Job Application via SFAPI JobApplication entity.
The below error occurs -

Invalid value for field 'mode' - Invalid enum value: '2' Avaliable enum values are: forwardCandidate, : 2

Environment

Boomi/PI/HCI/API Web Services

Reproducing the Issue

Create a Job Application using the JobApplication$792 entity with Insert Operation

Sample payload as below can trigger this error

<sfobject>
        <type>JobApplication$792</type>
        <jobReqId>1442</jobReqId>
        <candidateId>81</candidateId>
        <mode>2</mode>
      </sfobject>

Note - JobApplication followed by $XXX is the name of the SFAPI entity where XXX is a number that differs from one successfactors system to another.

Cause

The field values for "Mode" are pre-defined and they cannot be described in the API call.

Resolution

The error provides a hint of the available inputs to the field "Mode". 

Let us look at the error message again - 

Invalid value for field 'mode' - Invalid enum value: '2' Avaliable enum values are: forwardCandidate, : 2

From the SOAP request xml, We can see that we have entered the field value = "2" for the field "Mode" and this is not acceptable.
Above error indicates that the available values are for this field are "
forwardCandidate"

Hence, use the available field in the request payload as shown below -
<sfobject>
        <type>JobApplication$792</type>
        <jobReqId>1442</jobReqId>
        <candidateId>81</candidateId>
        <mode>forwardCandidate</mode>
      </sfobject>

When this Insert call is performed, System accepts the API operation and provides the corresponding response (Can be tracked in the SFAPI Audit logs)
<result>
        <jobStatus>OK</jobStatus>
        <message />
        <objectEditResult>
          <id>203</id>
          <errorStatus>OK</errorStatus>
          <editStatus>CREATED</editStatus>
          <index>0</index>
          <message xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true" />
        </objectEditResult>
      </result>


See Also

Please note that other fields entered in the request xml like jobReqId and candidateId have to exist in the successfactors system before they can be used to create the JobApplication

Keywords

JobApplication Insert fails Unable to create Jobapplication via API Invalid value for field 'mode' , KBA , LOD-SF-INT-RCM , RCM-Any Integration , Problem

Product

SAP SuccessFactors HCM Suite 1705