3

This is a pretty basic question but I have a list view that I created on a custom object that should be returning results but is not. Object B has a lookup field to Object A,.

So lets say I have 2 Object A records and the names are: "Some Text" and "Some Text 2014-2015"

I have a list view created on Object B and the filter criteria is:

ObjectB.ObjectA EQUALS Some text

Which returns 1 record. If I change the filter criteria to

ObjectB.ObjectA STARTS WITH Some text

It returns both records. Works good like this, but I need to only return the record for this year. So I changed the criteria to:

ObjectB.ObjectA EQUALS Some text  2014-2015

Which should return 1 record ("Some Text 2014-2015") but instead returns none. Even if I change teh criteria to

ObjectB.ObjectA STARTS WITH Some text 2014

It returns no results. It seems that once I put the year in the criteria the view stops returning results. This is being done in the UI and not in code. Has anyone encountered this before? I'm sure I must be missing something simple.

Thanks!

  • How about using "ObjectB.ObjectA CONTAINS Some text 2014". – A-d Sep 16 '14 at 22:00
1

Since you probably want records for this year, not last year, you'll need both 2014 and 2015 in your search string, likewise you would need 2015 and 2016 for next year. Try this:

Search Criteria

If you need even more complex requirements, then this interface can almost certainly handle them, eg you could do a query like this: More Complex Search Criteria

  • I unfortunately cannot use that criteria as I have different record names based on the year eg: Lead salesperson 2014-2015, Junior Salesperson 2014-2015 etc... – MikeInOak Sep 17 '14 at 16:45
  • Ok. Depending on wether you want to filter one of these records out or keep them in, you can write different filters. Currently, the filter I've got above will get both of them. I'll add a couple more points to the answer. – Caspar Harmer Sep 17 '14 at 18:19
  • Let me know your exact requirements - I'm certain they can be achieved using this interface. – Caspar Harmer Sep 17 '14 at 18:29
  • I had to include some extra exclusions but your method worked as a work around. The funny thing is that other string combinations worked just fine and this problem also doesnt appear in my sandbox. I still don't know why i cant use the equals operator for this particular case but as long as it works I'm happy. Thanks! – MikeInOak Sep 17 '14 at 19:42
  • Great - interesting to hear about the possible length restrictions to the filter params - you might have found a hidden SF limit. – Caspar Harmer Sep 17 '14 at 19:45
2

Try using

ObjectB.ObjectA CONTAINS Some text 2014-2015

OR

ObjectB.ObjectA CONTAINS Some text 2014
  • I second "ObjectB.ObjectA CONTAINS Some text 2014", since dashes can make things tricky. – Carolyn Grabill Sep 17 '14 at 0:04
  • Thanks, but I have tried both those scenarios and neither work. The only filter criteria that works is if I use "starts with" and I do not include 2014-2015 (or even just 2014) – MikeInOak Sep 17 '14 at 16:39
  • The funny thing is this filter criteria normally works in creating accurate list views. The only difference I can tell is that this criteria is longer than others. I wonder if there is a limit on how many characters the filter criteria can be? For example: ObjectB.ObjectA EQUALS Salesperson 2014-2015 works ObjectB.ObjectA EQUALS Some text 2014-2015 does not. THis oen is actually 35 characters and I wonder if its hitting a limit? – MikeInOak Sep 17 '14 at 16:46
1

Make sure there are no extra spaces in the criteria value. For instance, your 3rd attempt shows 2 spaces instead on 1. I tested in my dev instance and the following does provide the results you are looking for:

List View Criteria

  • Yes that extra space was a typo while I was posting this question. I copy and paste the record name directly into the filter criteria so I don't have any extra spaces, but no dice. – MikeInOak Sep 17 '14 at 16:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.