Happy Business Starts Here

Student

ZOQL - Salesforce Z-Force 360 Query field IN or INCLUDES collection/List

Hello folks,

 

The answer is probably no, but I was wondering if anyone has could tell me if ZOQL can use an IN or INCLUDES COLLECTION/LIST? I'm currently using the Z-Force 360 managed package for Salesforce utilizing the Zuora Order Builder wrappers. 

 

Essentially what I'm trying to do is get a list of records related to a list of subscription Ids. Something along these lines:

 

SELECT Id, fieldName FROM Table WHERE fieldName IN ListVariable

 

In apex it's simple:

 

[SELECT Id, fieldName FROM ObjectName WHERE fieldName IN :listVariable]

That being said I can due the whole fieldName = 'xyz' OR fieldName = 'abc' OR fieldName = 'zyx'....

 

I could also *gag* go through a loop and do a bunch of queries that way (it's a major no no in the Salesforce world); however, I would prefer to not go that way either.

 

So is anyone aware of what syntax I would need to use to query a field against a collection of values?

1 REPLY 1
Zuora Support

Re: ZOQL - Salesforce Z-Force 360 Query field IN or INCLUDES collection/List

Hi,

 

As you have checked, you can use the list of values using the OR clause, we do not support the list of values.






If you found my answer helpful, please give me a kudo ↑
Help others find answers faster by accepting my post as a solution √