Skip to Main Content
Created by Guest
Created on Jan 29, 2025

Allow more than 5 conditions in relationship filters

I have a DocGen package that requires more than 5 filter conditions to return the right data set. I would love to not need to create new checkbox formula fields for every DocGen package with complex filters.

Example:

SELECT fields FROM Session__c (a child object of Campaign, the starting object)
WHERE Campaign = '<<Campaign_Id>>'
AND Type__c NOT IN ('Value 1', 'Value 2', 'Value 3')
AND Status__c NOT IN ('Value 1', 'Value 2', 'Value 3', 'Value 4')
ORDER BY Start__c ASC
  • I need to return child records based on the value of two or more picklist fields being not equal to several picklist values.

  • This is easy to accomplish in a SOQL relationship, but I need to replicate my data by Group, and SOQL relationships don't support grouped replication.

  • It's possible to run the SOQL query inside an Apex relationship (Apex relationships support grouped replication), but I don't have the time or knowledge to implement custom code.

  • Creating formula fields is a straightforward solution, but it is not scalable in the long term. For example, my team has 9 variations of the document that requires the query shown above. If we opt for formula fields as a solution, we will have to create 9 new custom fields.

  • Attach files