View selection formula does not work

Hi there,

I created a new view (copied style from Inbox) in a mail-in database (dwa7 template). I want to filter/sort documents with a combination of what’s in the ‘SMTPOriginator’ and ‘Subject’ fields.

This is what I did:

I changed the view formula from:


tmpOldVersion := @If(@TextToNumber(@Version) < 174;@True;@False);

@If(

tmpOldVersion & form = "Notice"; "(R5Notice)";

tmpOldVersion & Form = "Appointment";"(R5CalendarEntry)";

Form="";@False;Form)

to :

Form = “Memo” & @Contains(SMTPOriginator; “abc.company.com”) & @Contains(Subject; “Vacation Request”)

I tested by sending some e-mails from my own ID. Since these were not SMTP there was no SMTPOriginator field. However the subject did not have “Vacation Request” in it, yet the document was visible in the view.

No matter what I do it stays the same (lists all the documents in the inbox). I tried:

Form = “Memo” & Subject =“”

but it made no effect.

I am sure I am making a fundamental mistake here. Any ideas?

Thanks for all your help.

Ayaz

Subject: View selection formula does not work…

Hi,

tmpOldVersion := @If(@TextToNumber(@Version) < 174;@True;@False);

@If(

tmpOldVersion & form = "Notice"; "(R5Notice)";

tmpOldVersion & Form = "Appointment";"(R5CalendarEntry)";

Form="";@False;Form)

looks to me more like a form formula and not a view document selection formula. Are you sure that you have created a view and not a folder. Are you sure you put your selection formula into the right place? A selection formula should start with a SELECT statement, e.g. SELECT Form=“Memo”

Best regards

Mario Varchmin

e-llennium GmbH

Subject: View selection formula does not work…

from designer help on the @Contains function:

“Note If any element in the substrings is a null string(”“), this function always returns true.”

That would explain maybe the SMTPOriginator part evaluating to true, but not the Subject part.

Try adding something stupid to the selection formula that you know would result in it being excluded from the view, something like " & DONTSHOWTHISDOCUMENT = 1

If you added that to your selection formula, it should result in a blank view. Then you can look into the @Contains thing further.

Just trying to help you brainstorm it.

  • Matt

Subject: View selection formula does not work…

($Inbox) is a Folder, not a View. It doesn’t have a selection formula. What you’ve been playing with is a Form Formula, which merely determines which form to use when a document is opened from the view/folder. Try restoring the original Form Formula, then clicking on the Selection Formula object and putting a selection formula there.

Subject: RE: View selection formula does not work…

That was it!

Thank you Sir!