Failed on parsing and getting query metadata error on Salesforce Order query

655 views Asked by At

I have a basic SELECT query on the Order object in Salesforce which is called from the Salesforce connector in Mule. The query is generated using Datasense Query Builder in the Salesforce connector but I keep getting an error "Failed on parsing and getting query metadata" and when I try to edit the query I see the following error msg box "* Malformed DataSense Query Language expression. Please check your query"

I'm confused why this is happening because the query is built using the Query Builder and not manual and I do not get the error if I create a query for the Account object in Salesforce so not sure when Order would be giving me an error.

Does anyone know what could be causing the Order query to fail?

I also find that when I switch to Native Query Language instead of Datasense Query Builder it works initially but later starts to return a graph error.

Simple Mule flow which gives me the same error:

<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:sfdc="http://www.mulesoft.org/schema/mule/sfdc" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:apikit="http://www.mulesoft.org/schema/mule/apikit" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:spring="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/apikit http://www.mulesoft.org/schema/mule/apikit/current/mule-apikit.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.mulesoft.org/schema/mule/sfdc http://www.mulesoft.org/schema/mule/sfdc/current/mule-sfdc.xsd">
    <http:listener-config name="myTest-httpListenerConfig" host="0.0.0.0" port="8081" doc:name="HTTP Listener Configuration"/>
    <apikit:config name="myTest-config" raml="myTest.raml" consoleEnabled="true" consolePath="console" doc:name="Router"/>
    <sfdc:config name="Salesforce__Basic_Authentication" username="${sf.user}" password="${sf.pwd}" securityToken="${sf.token}" doc:name="Salesforce: Basic Authentication"/>
    <flow name="myTest-main">
        <http:listener config-ref="myTest-httpListenerConfig" path="/api/*" doc:name="HTTP"/>
        <apikit:router config-ref="myTest-config" doc:name="APIkit Router"/>
        <exception-strategy ref="myTest-apiKitGlobalExceptionMapping" doc:name="Reference Exception Strategy"/>
    </flow>

    <flow name="get:/orders:myTest-config">
        <sfdc:query config-ref="Salesforce__Basic_Authentication" query="dsql:SELECT Id FROM Order" doc:name="Salesforce"/>

    </flow>

    <apikit:mapping-exception-strategy name="myTest-apiKitGlobalExceptionMapping">
        <apikit:mapping statusCode="404">
            <apikit:exception value="org.mule.module.apikit.exception.NotFoundException" />
            <set-property propertyName="Content-Type" value="application/json" doc:name="Property"/>
            <set-payload value="{ &quot;message&quot;: &quot;Resource not found&quot; }" doc:name="Set Payload"/>
        </apikit:mapping>
        <apikit:mapping statusCode="405">
            <apikit:exception value="org.mule.module.apikit.exception.MethodNotAllowedException" />
            <set-property propertyName="Content-Type" value="application/json" doc:name="Property"/>
            <set-payload value="{ &quot;message&quot;: &quot;Method not allowed&quot; }" doc:name="Set Payload"/>
        </apikit:mapping>
        <apikit:mapping statusCode="415">
            <apikit:exception value="org.mule.module.apikit.exception.UnsupportedMediaTypeException" />
            <set-property propertyName="Content-Type" value="application/json" doc:name="Property"/>
            <set-payload value="{ &quot;message&quot;: &quot;Unsupported media type&quot; }" doc:name="Set Payload"/>
        </apikit:mapping>
        <apikit:mapping statusCode="406">
            <apikit:exception value="org.mule.module.apikit.exception.NotAcceptableException" />
            <set-property propertyName="Content-Type" value="application/json" doc:name="Property"/>
            <set-payload value="{ &quot;message&quot;: &quot;Not acceptable&quot; }" doc:name="Set Payload"/>
        </apikit:mapping>
        <apikit:mapping statusCode="400">
            <apikit:exception value="org.mule.module.apikit.exception.BadRequestException" />
            <set-property propertyName="Content-Type" value="application/json" doc:name="Property"/>
            <set-payload value="{ &quot;message&quot;: &quot;Bad request&quot; }" doc:name="Set Payload"/>
        </apikit:mapping>
    </apikit:mapping-exception-strategy>
</mule>

Thanks for any help

0

There are 0 answers