Ask the Expert

Filtering my view using a variable as my criteria?

I created a view base on variable criteria. @Environment does not work on selection formula, so I tried using @GetprofileField. But, it doesn't seem to work. Is there any other way I can filter my view using a variable as my criteria? My code goes like this: addrbook := @GetProfileField("User Profile";"Department";@UserName); SELECT Form = "RF" & DepartmentCB = addrbook the objective is to filter the view base on user's department but I do not want to hardcode the department's name.
Try this alternative:

1. Create a view, categorizing it on the department (DepartmentCB) and save it. I would make a copy of the view you are trying to get to, now, or just insert a new column into the front of the view, categorized on the department, and save it.
2. Create a Page
3. Embed a view in the page (Create -> Embedded Element -> View)
4. Select the view you just created or modified from the dialog box and hit OK 5. Choose "Show Single Category" as the event.
6. Put your code here. I'd put either your @Environment (make sure it equals the name of one of the categories) or your @GetProfileField.
7. Save it.

This will make it a Page, not technically a View. But you can, using an outline or navigator, make that fact completely transparent to the user. This works in Notes and the Web.

This was first published in August 2002

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to: