Mule中的salesforce连接器-SOQL长查询对于某些对象无法正常工作-如product2

时间:2018-07-13 14:23:22

标签: mule mule-component mule-el mule-esb mule-connector

在Mule salesforce Connector中运行product2 SOQL长查询时遇到问题。我能够运行并获得成功的json消息,其中包含ID,Name,ProductCode,Description等某些字段。但是其他某些字段则无法正常工作,例如... Units__c,Stock_Item__c,Sub_Category__c等。在“ DataSense查询语言”中使用“查询生成器”进行选择时,非工作字段也不可用。我想这些字段是我组织的风俗习惯。但是,所有类型的查询都可以在Salesforce开发人员控制台上正常运行。我正在寻找解决方案,以便可以使用salesforce产品对象的结果调用所有字段。

也尝试过:

  1. 使用本机查询语言。但没有成功。

谢谢!

M配置XML

   <flow name="salesforce_invoking_all_product2_information_flow">
        <logger level="INFO" doc:name="Get product2 -Start" message="Get product2- Start"/>
        <dw:transform-message doc:name="Transform Message">
            <dw:input-payload doc:sample="sample_data\json.json"/>
            <dw:input-inbound-property doc:sample="sample_data\Map_1.dwl" propertyName="http.query.params"/>
            <dw:set-variable variableName="lastModifiedDateTime"><![CDATA[%dw 1.0
%output application/java
---
(((inboundProperties."http.query.params".lastModifiedDate as :string)
    as :localdatetime {format: "yyyyMMddHHmmss"})
    as :string  {format: "yyyy-MM-dd'T'HH:mm:ss'.000Z'"})
    ]]></dw:set-variable>
        </dw:transform-message>
        <sfdc:query-all config-ref="Salesforce_Basic_Authentication" query="dsql:SELECT Id, Name, ProductCode, Description, IsActive, CreatedDate, CreatedById, LastModifiedDate, LastModifiedById, SystemModstamp, RecordTypeId, Family, ExternalDataSourceId, ExternalId, DisplayUrl, QuantityUnitOfMeasure, IsDeleted, LastViewedDate, LastReferencedDate, Account_Number__c, Color__c, Cost_PO__c, Inventoried_Item__c, Length__c, Paint_Stain_Misc_Job_and_Unit_Charges__c, Style_Code__c, SalesforceID__c, Units__c, Number_Service_Products__c, Master_Legacy_Product__c, Has_Service_Products__c, Products_Joined__c, Number_of_Units__c, Mull_Sequence__c, Mull_Number__c, Mull_Material__c, Mull_Assembly_Type__c, isStandard__c, Unit_of_Measure__c, Stock_Item__c, Sub_Category__c, Cross_Reference__c, Width__c, Category__c, Pivotal_Id__c, Height__c, Unit_Short_Description__c, UI_Minimum__c, UI_Maximum__c, Service_PO__c, Report_Grouping__c, Master_Product__c, Name_Part_Number__c, Part_Number__c, Product_Configuration__c, Product_Image__c, Vendor__c, Product_PO__c, Product_Type__c FROM Product2 limit 10" doc:name="get product 2 details"/>
        <json:object-to-json-transformer doc:name="Object to JSON"/>
        <logger message="Get Contact- Finish" level="INFO" doc:name="Get Product 2 Finish"/>

    </flow>

错误控制台

Message               : org.mule.modules.salesforce.exception.SalesforceException (org.codehaus.jackson.map.JsonMappingException)
Payload               : org.mule.streaming.ConsumerIterator@6b1280fb
Transformer           : ObjectToJson{this=599abd04, name='ObjectToString', ignoreBadInput=false, returnClass=SimpleDataType{type=java.lang.String, mimeType='application/json', encoding='null'}, sourceTypes=[]}
Payload Type          : org.mule.streaming.ConsumerIterator
Element               : /salesforce_invoking_all_product2_information_flow/processors/3 @ rba-salesforce-product-system:implementation.xml:26 (Object to JSON)
Element XML           : <json:object-to-json-transformer doc:name="Object to JSON"></json:object-to-json-transformer>
--------------------------------------------------------------------------------
Root Exception stack trace:
[InvalidFieldFault [ApiQueryFault [ApiFault  exceptionCode='INVALID_FIELD'
 exceptionMessage='
Style_Code__c,SalesforceID__c,Units__c,Number_Service_Products__c
                              ^
ERROR at Row:1:Column:390
No such column 'Units__c' on entity 'Product2'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.'
 extendedErrorDetails='{[0]}'
]
 row='1'
 column='390'
]
]

    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at java.lang.Class.newInstance(Class.java:442)
    at com.sforce.ws.bind.TypeMapper.readSingle(TypeMapper.java:673)
    at com.sforce.ws.bind.TypeMapper.readObject(TypeMapper.java:556)
    at com.sforce.ws.transport.SoapConnection.parseDetail(SoapConnection.java:236)
    at com.sforce.ws.transport.SoapConnection.createException(SoapConnection.java:210)
    at com.sforce.ws.transport.SoapConnection.receive(SoapConnection.java:156)
    at com.sforce.ws.transport.SoapConnection.send(SoapConnection.java:99)
    at com.sforce.soap.partner.PartnerConnection.queryAll(PartnerConnection.java:836)
    at org.mule.modules.salesforce.SalesforceConnector$2.doQuery(SalesforceConnector.java:877)

0 个答案:

没有答案