SAP Knowledge Base Article - Public

2372331 - Error: "Failed to retrieve result with given criteria." occurs when trying to filter on a picklist field using oData API - Recruiting Management

Symptom

You get the following error message, when you try to filter your OData API query using picklist (e.g. picklist ID): "Failed to retrieve result with given criteria":

Image/data in this KBA is from SAP internal systems, sample data, or demo systems. Any resemblance to real data is purely coincidental.

28-09-2016 13-57-15.png

Environment

SAP SuccessFactors Recruiting Management

Reproducing the Issue

Query an entity using OData API and use a custom picklist field in order to filter the results, e.g.:

https://apisalesdemo4.successfactors.com/odata/v2/JobApplication?$format=json&$filter=assessmentStatus/id eq '381'&$expand=assessmentStatus

Cause

The custom picklist field has to be a reportable field in order to use it as a filter in the OData API call.

Resolution

The field definition ID has to be added to reportable custom fields. The ID can be found either in the oData API Dictionary, e.g.:


28-09-2016 14-17-30.png

or in the relevant XML template, e.g.:

<field-definition id="assessmentStatus" type="picklist" required="false" custom="true" public="false" readOnly="false" anonymize="false" forward-intact="true">
<field-label mime-type="text-plain"><![CDATA[Assessment Passed: ]]></field-label>
<field-description><![CDATA[Assessment Status]]></field-description>
<picklist-id>yesNo</picklist-id>
</field-definition>

If you are a Partner go to Provisioning > Configure Reportable Custom fields and add the field definition to reportable custom fields, e.g.:


28-09-2016 13-58-33.png

If you are a customer, please contact your Implementation Partner or SAP Product Support in order to make the field reportable.

 

More information on reportable custom fields can be found in the following Knowledge Base Article: 2081508

Keywords

Failed to retrieve result with given criteria. RCM, Picklist, Odata, filter , KBA , LOD-SF-RCM-API , Webservices & APIs , LOD-SF-INT-API , API & Adhoc API Framework , Problem

Product

SAP SuccessFactors Recruiting all versions