Community
Showing results for 
Search instead for 
Do you mean 
Reply

GetCustomEntities Filter clause "AND" and "OR"

Nickel Contributor
Posts: 163
Country: USA

Re: GetCustomEntities Filter clause "AND" and "OR"

We're probably dealing with different versions then. I'm basically out of ideas. The only other thought I had is to dig through the stack trace to see if you can find some clues on the cause.
Tuned Listener
Posts: 43
Country: Canada

Re: GetCustomEntities Filter clause "AND" and "OR"

Thanks for you help, good ideas but something funky is still going on. If anyone out there is able to get this to work in their environment please let me know. Really need to figure this out. Unless there is a better way to have two or more equals to values. Thanks!

Nickel Contributor
Posts: 163
Country: USA

Re: GetCustomEntities Filter clause "AND" and "OR"

Have you tried using an InFilterCriteria? It takes a field descriptor and an Array of literal values. For some reason I used that at one point instead of a ComparisonFilterCriteria even though I only had one value in the array. I mention this because I haven't tried it with 2 or more values.
Highlighted
Tuned Listener
Posts: 43
Country: Canada

Re: GetCustomEntities Filter clause "AND" and "OR"

Brilliant, thank you so much I didn't even think of that, that worked perfectly for me, and you can use multiple fields as well which is great. Below is what I ended up using. Only downside is it is essentially using and AND option with no way to use an OR option as far as I can see, but to me thats Ok for now because the AND was more important. If anyone later on tests it and can get the OR method working with the ComparisonFilter Criteria, or has another way to do an OR filter, please let me know.

 

 

                    Dim filter As New InFilterCriteria(manager.GetCustomEntityFieldDescriptor("Status", Act.Framework.MutableEntities.FieldNameType.[Alias]), New String() {"Active", "Closed"})

                    Dim filter2 As New InFilterCriteria(manager.GetCustomEntityFieldDescriptor("Product", Act.Framework.MutableEntities.FieldNameType.[Alias]), New String() {"ACT V18 Premium", "ACT V19 Premium"})

 

   customSubEntities = manager.GetCustomEntities(Nothing, New InFilterCriteria() {filter, filter2})