Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have 2 custom objects related to each other. The first custom object Trial__c has a lookup to custom object OpportunityLineItem2__c.
The lookup is TRI_LKP_Product__c.
I want to get the Name field of OpportunityLineItem2__c by doing a query on Trial__c.
To do this, in the metadata that I get from Salesforce I create a variable as indicated in the Talend documentation:
The correct syntax is NameofCurrentObject_NameofLinkedObject_NameofColumnofInterest
The variable I create has the following name:
Trial__c_OpportunityLineItem2__c_Name
Then I put a tSalesforceInput and perform a manual query like this:
"SELECT Id, TRI_LKP_Product__r.Name FROM Trial__c"
Then I connect the tSalesforceInput to a tLogRow but receive the null value in that field.
Could someone tell me what I am doing wrong and could please help me?
Thank you very much in advance!
Finally I was able to get the fields of the related custom object. The syntax was not correct. The documentation indicates that the syntax should be:
NameofCurrentObject_NameofLinkedObject_NameofColumnofInterest
But the correct syntax to make it work is:
NameofCurrentObject_NameofFieldInRelationMode_NameofColumnofInterest
In my example:
Trial__c_TRI_LKP_Product__r_Name
Thanks and regards!
Hello,
Could you please post your whole job design screenshots here? Which will be helpful for us to address your issue.
Best regards
Sabrina
Hi @Xiaodi Shi ,
I have created a new job with only the tSalesforceInput and the tLogRow and the same thing keeps happening.
Thanks and regards!!
Hello,
Have you tried to verify the salesforce custom object permissions and do this kind of SOQL query to see if there any query result returned via Logging in to the Salesforce workbench?
Best regards
Sabrina
Hi @Xiaodi Shi
Yes, i´ve tried that.
It happens with all custom objects, for example, I have another lookup in Contact that points to another custom object "Dialing_Code__c" and the same thing happens. If I do it with standard objects there is no problem, for example, Contact_Account_Name works fine but if I do it with a custom object it returns nothing.
Is the syntax correct?
do you have any example where you do a query with custom objects?
Thanks and regards!
Hello,
Here is a KB article: https://community.talend.com/s/article/Learned-by-Doing-How-to-create-and-use-a-Salesforce-custom-ob...
Let us know if it helps.
Best regards
Sabrina
Hi @Xiaodi Shi ,
I don't see any relation between my question and the post in the link. In the post there is no query to a related custom object in Salesforce.
Thanks and regards!
Finally I was able to get the fields of the related custom object. The syntax was not correct. The documentation indicates that the syntax should be:
NameofCurrentObject_NameofLinkedObject_NameofColumnofInterest
But the correct syntax to make it work is:
NameofCurrentObject_NameofFieldInRelationMode_NameofColumnofInterest
In my example:
Trial__c_TRI_LKP_Product__r_Name
Thanks and regards!
Hello,
Thanks for letting us know you are able to get the fields of the related custom object and marking this topic as resolved.
Best regards
Sabrina