0

在 Mule Salesforce 连接器中运行 product2 SOQL 长查询时遇到问题。我能够运行并获得带有某些字段(如 Id、Name、ProductCode、Description 等)的成功 json 消息。但是其他一些字段无法正常工作... Units__c、Stock_Item__c、Sub_Category__c 等。当我在“DataSense 查询语言”中使用“查询生成器”进行选择时,非工作字段也不可用。我猜这些字段是我的组织制定的。但是各种查询在 Salesforce 开发人员控制台上都可以完美运行。我正在寻找解决方案,以便我可以使用来自 salesforce 产品对象的结果调用所有字段。

也试过:

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

提前致谢 !

骡子配置 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)
4

0 回答 0