I have a view where the first column is categorized and sorted. This column contains the abbreviated name of the user who created the document (ex: John Doe/Ohio). This view is used on the web.
I want to use the restricttocategory in a url to show only the viewing user’s documents. Here is the code:
user := @Text(@Name([Abbreviate];@UserName));
“http://server//folder/dbname.nsf//viewname?openview&RestrictToCategory=” + user
The URL works, however the restricttocategory does not. All documents for all users are listed.
What am I doing wrong? Thanks in advance for the help.
Subject: No Luck with restricttocategory
You might also want to try putting your view inside a $$ViewTemplate for… form, put the view in this form as an embedded view and use the show single category option for the embedded view, this way Notes handles the encoding when the view is shown. This is actually the way private views in Lotus Workflow database views work on the web.
Subject: No Luck with restricttocategory
I would verify that the “/” in the abbreviated name is not causing the problem. Try categorizing by the common name only and test.
Subject: RE: No Luck with restricttocategory
URL encoding the parameter for restrictocategory should work, too.
Subject: RE: No Luck with restricttocategory
not the problem
Subject: RE: No Luck with restricttocategory
‘Space’ is also not generally considered a legal URL character. Please try using the @UrlEncode function on your key value.
If that doesn’t solve the problem, then since it doesn’t appear that anyone recognizes your problem, and since RestrictToCategory works generally, there has to be something special about your situation that you’re not telling us about. You might think about providing additional information to see whether it gives anyone a clue. For instance:
Where is this formula that you showed us?
The formula just returns a URL. What are you doing to let the user navigate to that URL?
What is the URL in the browser window when the incorrect results are displayed?
What exactly do you mean “All documents for all users are listed”? Are the category headings listed also? Is there any difference compared to the way the view looks when you open it “normally”?
Do you intend this view to be used only as a “my documents” view, in which case why not just use the single category formula of the embedded view instead of writing complicated formulas to create links from elsewhere?
BTW: @V3UserName returns the exact value you want as your key, and it’s not necessary to convert the username to text – it is already text.
Subject: RE: No Luck with restricttocategory
It was the space in the url that caused the problem. The @URLEncode did the trick. Thanks for your help.