SAP Knowledge Base Article - Public

2397142 - CompoundEmployee API throws the error "The provided SFQL does not contain valid expressions"

Symptom

  1. You want to query the data for the extension fields using CompoundEmployee API 
  2. You face the following error in the response "Invalid SFQL! Error: The provided SFQL does not contain valid expressions"

Environment

BizX, SFAPI

Reproducing the Issue

SOAP REQUEST:

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns="http://schemas.xmlsoap.org/soap/envelope/">
  <SOAP-ENV:Header />
  <SOAP-ENV:Body>
    <query xmlns="urn:sfobject.sfapi.successfactors.com">
      <queryString>SELECT person/employment_information/employment_id FROM CompoundEmployee</queryString>
      <param>
        <name>agent</name>
        <value>ce_CE_1611_test</value>
      </param>
   </query>
 </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

 

SOAP RESPONSE:

<?xml version="1.0" encoding="UTF-8"?>
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
    <S:Body>
        <ns2:Fault xmlns:ns2="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns3="http://www.w3.org/2003/05/soap-envelope">
           <faultcode>ns2:Server</faultcode>
           <faultstring>SFAPI Domain Error!</faultstring>
           <detail>
             <ns2:SFWebServiceFault xmlns:ns2="urn:fault.sfapi.successfactors.com" xmlns="urn:sfobject.sfapi.successfactors.com">
                <ns2:errorCode>INVALID_SFQL</ns2:errorCode>
                <ns2:errorMessage>Invalid SFQL! Error: The provided SFQL does not contain valid expressions</ns2:errorMessage>
             </ns2:SFWebServiceFault>
          </detail>
       </ns2:Fault>
   </S:Body>
</S:Envelope>

Cause

The format of the query passed is wrong.

Resolution

Use this query as an example:

SOAP REQUEST:

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns="http://schemas.xmlsoap.org/soap/envelope/">
   <SOAP-ENV:Header />
   <SOAP-ENV:Body>
     <query xmlns="urn:sfobject.sfapi.successfactors.com">
       <queryString>SELECT person/extensionFields FROM CompoundEmployee where person_id_external='admin'</queryString>
       <param>
         <name>agent</name>
         <value>ce_CE_1611_test</value>
       </param>
    </query>
 </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

SOAP RESPONSE:

<?xml version='1.0' encoding='UTF-8'?>

<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">

    <S:Body>

        <queryResponse xmlns="urn:sfobject.sfapi.successfactors.com" xmlns:ns2="urn:fault.sfapi.successfactors.com">

            <result>

                <sfobject>

                    <id>2</id>

                    <type>CompoundEmployee</type>

                    <person>

                        <person_id>2</person_id>

                        <employment_information>

                            <employment_id>322</employment_id>

                            <user_id>admin</user_id>

                        </employment_information>

                        <extensionFields>

                            <ce_field7>322</ce_field7>

                            <person_id>2</person_id>

                        </extensionFields>

                    </person>

                    <execution_timestamp>2016-11-28T14:22:27.000Z</execution_timestamp>

                    <version_id>1611P0</version_id>

                </sfobject>

                <numResults>1</numResults>

                <hasMore>false</hasMore>

                <querySessionId>68df2792-ad11-41d4-8d21-ea70a057324a</querySessionId>

            </result>

        </queryResponse>

    </S:Body>

</S:Envelope>

Keywords

KBA , LOD-SF-INT-API , SF API & Adhoc API Framework , Problem

Product

SAP SuccessFactors HCM Core 1611 ; SAP SuccessFactors HCM Core 1702