what is the most efficient way to query Salesforce with the dataset from a previous component as input?
Good afternoon. I'm on my first project using Talend and I am wondering what the most efficient way is to query Salesforce using a previously retrieved dataset.
To sketch the scenario, I have first pulled a set of invoices from an Invoice object in SFDC - this dataset is inserted into a database table. From here I need to select the distinct set of Account IDs, to then query a different SFDC object using said Account IDs.
Writing it as a SQL it would look like this:
SELECT distinct BillingAccountID__c, BankCode__c, AccountNumber__c , AccountName__c FROM AccountPaymentDetails__c WHERE BillingAccountID__c IN (select distinct AccountID from CurrentInvoices);
The distinct in the main query is optional as I could resolve that with a separate de-duplication activity before inserting into its own database table; the distinct in the subquery is mandatory as it's possible to have multiple invoices per Account.
I previously spent a fair bit of time to get all required data pulled in a single SOQL, but the relationships between objects are either missing, or set up the wrong way around, and as our SFDC instance is already heavily customised the SF team is loath to add more. Therefore it'll have to be done as a 2-step process, with like a correlated subquery.
So, long story short: what would be the best way to handle this in Talend?