I’m a notes 6.5 newby trying to create a view based on a SELECT formula that selects mails containing certain keywords in their text. I’ve googled for how to do this and looked in the online help but I haven’t found an easy solution. It needs to be in a SELECT formula so as to combine selection criteria such as author and mail date. Searching in the attachments would be interesting but isn’t necessary at this time.
Subject: View formula with criteria on mail contents
Presumably, by “in their text” you mean “in their Body field” and this you will find cannot work.
For the other fields you mentioned, i.e. Author and Mail Date, you would need to be more specific. Do you mean the sender of the mail? And is it internet mail (external) or Notes mail (internal)? You can check the From field (which may be RFC822 Text) as well as the SMTPOriginator for internet messages.
Mail Date can be one of (not sure which one is appropriate for you): DeliveredDate, PostedDate and perhaps others from which you can deduce the time.
Sorry to give you a vague response but as you will soon see, your question was also a bit vague.
Subject: RE: View formula with criteria on mail contents
Cesar,
Thank you for your response. My question is how to create a view with a select formula that performs a search in the body field, and if this is not possible for what reason is this the case.
Subject: RE: View formula with criteria on mail contents
RichTextItems like “Body” in a mail document are not summary data and as a result cannot be used in views. Normally, you can use @Abstract to extract the text representation of the contents of a RichTextItem (ignoring attachments, objects, etc.) but that also cannot be used views. In fact, IBM posted this to illustrate a workaround:
Unfortunately, a BodyText field will not exist in your mail document so unless you create that field programatically by an agent, you also cannot use that workaround - that was intended more for custom applications and not mail.
Subject: RE: View formula with criteria on mail contents
Well, it IS possible, of course. Just not using such a basic technique. What might look simple from the outside, can in reality be rather complicated or vice versa.
In this case, a view is just not the right tool (because of the way Notes is designed from ground up, not because the idea to use it would be silly). You already gave the answer yourself: What you need is a search, not a select statement. And that will take care of attachments, too. Just in case you have a relational background: Try not to thing about view selection formulas too much like SQL select statements. Things are pretty different.
Now, on to a (hopefully viable) solution: It can be done WITHOUT any programming! Interested? Here’s how.
Make sure that your mail database has a full text index. In the indexing option you can - amongst other settings - control, if attachments should be searched using Notes’ conversion filters, making the search more reliable.
Go to the view or folder you want to search in.
If not already visible, open the searchbar (View → Search View) and click on the word “more” to the right.
Click on “Fill out sample form” and make sure that in the dialogbox form “Memo” is selected.
Enter the words you want to search for into the appropriate fields (including the mail body!) and click on add.
Click on “Search” and your done.
Not what you wanted? You don’t want to type in those field values again and again? Well, you better learn how to type faster. No, I’m only kidding. Instead, take note of the buttons “Save Search” and “Load Search”. You shouldn’t need more advice to use them.