Symptom
Client submitted an odata api request using Job Requisition Entities but received an error that says "[COE0019]while trying to invoke the method com.successfactors.rcm.api.bean.OperatorRoleEnum.getId() of a null object loaded from local variable 'role' with the index 0"
Environment
SAP SuccessFactors Recruiting Management
Reproducing the Issue
- Open Postman or any 3rd party REST Application
- Create a request using jobRequisition ODATA API entity
- Error occurs: "[COE0019]while trying to invoke the method com.successfactors.rcm.api.bean.OperatorRoleEnum.getId() of a null object loaded from local variable 'role' with the index 0"
Cause
The error is telling us that an Operator role being called by the request is not defined correctly in the Job Requisition XML template.
Resolution
To fix this issue and to avoid getting the error, please review the xml code and check each operator type field and verify if they defined correctly.
Example:
<field-definition id="originator" type="operator" required="true" custom="false">
<field-label><![CDATA[Creator of the job req ("O" role)]]></field-label>
<field-description><![CDATA[Creator of the job req ("O" role)]]></field-description>
</field-definition>
**** If you check the above xml code it shows that the field type operator uses originator as the field id, this is a misconfiguration, the correct field id should be originatorName ****
The correct XML code for the above example is
<field-definition id="originatorName" type="operator" required="true" custom="false">
<field-label><![CDATA[Creator of the job req ("O" role)]]></field-label>
<field-description><![CDATA[Creator of the job req ("O" role)]]></field-description>
</field-definition>
See Also
2341070 - API services for Recruiting Management - SFAPI and oData API - Recruiting Management
2848692 - How to Create Job Requisition via ODATA API - Recruiting Management
Keywords
COE0019, jobRequisition, entity , KBA , LOD-SF-RCM-API , Webservices & APIs , Problem