salesforce SOQL

Highlighted
Five Stars

salesforce SOQL

I am trying to pull a fields value from Salesforce using Talend.  The field name in this case is Afieldname__c and has a datatype=Lookup(AnObject) where AnObject is the object name in Salesforce that has the Afiledname_Org__c field name i am trying to query.

 

The error i am getting is :

java.io.IOException: [InvalidFieldFault [ApiQueryFault [ApiFault exceptionCode='INVALID_FIELD'
exceptionMessage='
SELECT Afieldname__c

 

Does anyone know how I need to setup my schema and construct the query, or dealt with something similar?  Please let me know.

 

Thank you for your support.

Tags (2)

Accepted Solutions
Fifteen Stars TRF
Fifteen Stars

Re: salesforce SOQL

1rst, you must be sure the user you use for the connection has the visibility on the fields you want to query.

2nd, as soon as you don't try to query fields from an associated object, don't use the "Manual query" option. Just complete the schema for the tSalesforceInput component, that's all.

If you want to query a field from a parent object (for example, the object associated with the component is Contact and you want to query Account field), you need to write the query using the dot notation as for any SOQL query (Account.Name in my example).

If the relationship is based on a custom field, you need to replace the "__c" by "__r". For your case, the query must be "Afieldname__r.Afiledname_Org__c".

The last but not the least, in schema you need to replace dots by underscrores characters. If your case, the field in the schema must be "Afieldname__r_Afiledname_Org__c".

Hope this helps.


TRF
Five Stars

Re: salesforce SOQL

Thank you...


All Replies
Fifteen Stars TRF
Fifteen Stars

Re: salesforce SOQL

1rst, you must be sure the user you use for the connection has the visibility on the fields you want to query.

2nd, as soon as you don't try to query fields from an associated object, don't use the "Manual query" option. Just complete the schema for the tSalesforceInput component, that's all.

If you want to query a field from a parent object (for example, the object associated with the component is Contact and you want to query Account field), you need to write the query using the dot notation as for any SOQL query (Account.Name in my example).

If the relationship is based on a custom field, you need to replace the "__c" by "__r". For your case, the query must be "Afieldname__r.Afiledname_Org__c".

The last but not the least, in schema you need to replace dots by underscrores characters. If your case, the field in the schema must be "Afieldname__r_Afiledname_Org__c".

Hope this helps.


TRF
Five Stars

Re: salesforce SOQL

Thank you...

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 2

Part 2 of a series on Context Variables

Blog

Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables

Blog

Best Practices for Using Context Variables with Talend – Part 3

Read about some useful Context Variable ideas

Blog