function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Scott Nelson SolutionistScott Nelson Solutionist 

SOQL cross object query

I need some help creating a SOQL query or confirmation that it cannot be done. The requirements are as follows:
  1. Custom Object 1 has a relation to Cases.
  2. Custom Object 2 has a relation to Cases.
  3. Selection criteria for the query are available only in Custom Object 1.
  4. I need all of Custom Object 2 related to the Cases that are related to the selected list of Custom Object 1.
  5. It needs to be done in a single SOQL query.
This will be called using Informatica and I do not have permission to make changes to the schemas or processes in Salesforce to make this simpler. I also do not have access to a database to sync with Custom Object 2 and use it as a lookup to do it cleanly in two queries. The current approach is to get all of Custom Object 2 and use it as a lookup, which is not scalable.
Thanks in advance for your input and assistance.