Using !@Contains in formula for notesdatabase.search

Hi,

I am having pile of document that I am trying to do a Notesdatabase.search on a formula I build during the course of the lotusscript agent.

This works nicely until I come to the adding the condition " !@Contains(CategoryPerson; ‘IBM Business Partner’)" which will not work as expected since the field CategoryPerson is multivalue and it seems it that the search only look at the first value.

I know the formula works since I successfully tested it in a view.selection formula and it’s not a blocking problem since I can solve it in another way, but it would be very nice to solve everything in the notesdatabase.search so any help is appreciated.

Regards Palle

Subject: @Contains does not work differently in NotesDatabase.Search

The code to evaluate the @Contains function is the same in all contexts, and it contains no test for whether you’re running from NotesDatabase.Search vs. a view selection.

Therefore, if it’s not working, you must either be giving it different input than you thought you were, or else there’s something about the way you’re testing the results that’s giving you a wrong answer about whether the documents you’re interested in are included. I suspect the latter.

Incidentally, @Contains is the wrong function to use for finding out whether a value appears in a list. @Contains tests substrings, which you don’t need to do in this case. Use the = operator instead, or @IsMember.

  • Andre Guirard, IBM/Lotus Development

Useful blog: Best Practice Makes Perfect

NOTE: My policy is to post only two responses to the same question. So that my second response can solve your problem rather than being a request for details, please read the C R I S P Y document.