XPages View by @Username

Greetings, I am trying to find a way to have a view in xpages that only shows documents that match the current username to the name field. In prior versions I would use an embedded view. Currently I have not be able to find any instruction on this. I would appreciate it if someone could point me in the right direction.

Thanks

Subject: Have you looked at view filtering?

On a view data source there are a couple of properties you could use. Have a look at the ‘keys’ property. In the example below the view data is filtered with the value form a scoped variable ‘sessionScope.nameToSearch’. You could use this for @UserName().The property ‘keysExactMatch’ will filter the view to the exact match to the search query.

Have a look at the ‘categoryFilter’ property. this is more or less the same as Keys filtering but works on categorized views.

Then there’s the ‘search’ property that works only for databases that are fully indexed for Full Text Search.

Subject: Thanks!

Thanks Paul, I tried using Keys but couldn’t get it to work. Category Filter worked great with my code below. Thanks again

var usrname:NotesName = session.createName(@UserName());

usrname = usrname.getAbbreviated();

sessionScope.queryString = usrname;

return usrname