View selection by @Maildbname? help!

Hi,need some help over here on view selection.

are we able to do view selection based on the user’s mail server?

i’ve tried this but cant work :

SELECT @IsMember(site; @MailDbName)

Site in this case is selected (per documnet) by user based on their location, eg Malaysia, Singapore, etc

Purpose of the view selection as seen above is to display the related site documents based on where the user is from.

==> if user’s mail server is Malaysia_1, will display all documents whereby site = Malaysia.

Any suggestion is welcome.

Subject: view selection by @Maildbname? help!

Hi…My Approach will be…

Will create an Agent with new form … and which performs same action as above and will have readers field in that form.

As the end users clicks the button , the agents makes lookup and will create documents… which are private to user…

Subject: RE: view selection by @Maildbname? help!

Hi,thanks for your response.

but i might be having prob with this method cos the main concept for my views will be as such :

Project Register DB

My Site

  • summary

  • by Date

  • by person-in-charge

Other Sites

  • summary

  • by Date

  • by person-in-charge


so in this case, when user click on views under “my site”…will display all the projects for the respective site

and when user click on “Other Sites”…the views will display all projects including those in user’s site.

thus if i put name in reader field, it will not help.

Subject: RE: view selection by @Maildbname? help!

Remove the readers field…

Change the view selection programmtically…

By view … will be only the current user

All View… All documents…

You can trim your code for the programmitically changing hte

view selection… use the current user name to get collection…

Sub Initialize

Dim session As New NotesSession

Dim rightNow As New NotesDateTime(Now)

Dim db As NotesDatabase

Dim view As NotesView

Dim selection As String

Set db = session.CurrentDatabase

Set view = db.GetView(“Last 14 Days”)

Call rightNow.AdjustDay(-14)

selection = “SELECT @Created > @Date(”

selection = selection & Cstr(Year(rightNow.LSLocalTime)) & "; "

selection = selection & Cstr(Month(rightNow.LSLocalTime)) & "; "

selection = selection & Cstr(Day(rightNow.LSLocalTime)) & “)”

view.SelectionFormula = selection

End Sub

Subject: RE: view selection by @Maildbname? help!

hmmm…another qns…anyone knows why this view selection works :

SELECT @IsMember(@Name([CN];@UserName) ; PDelegation)

whereby PDelegation contains names of users involved

but this doesn’t?? :

SELECT @IsMember(site ; @Maildbname)

whereby the site field contains the country name and the mail server is usually named according to the country it’s residing.

eg, singapore mail server will be “Singapore_1” etc

thus if site = Singapore, then the above select statement shd work.