January 2005 - Posts

Give Your Tablet PC OS a Fresh Look
Sunday, January 30, 2005 4:42 PM

It's the simple things in life that sometimes make the biggest difference.

There is a Tablet PC Blue Energy Theme for Windows XP.  It just gives your computer a brigher bluer feeling. 

This is the same theme that users of Windows XP Media Center Edition 2005 got with their Media Center, and now you can sport it on your tablet.  It's a nice little change.

by wkriebel | with no comments
Filed under:
Using InfoPath and SharePoint to Create Personalized Views
Monday, January 24, 2005 2:12 PM

Systems know who you are, but SharePoint and/or InfoPath solutions rarely take advantage of that awareness.  Here is an easy way to create a more personalized experience for your users using built-in functionality of InfoPath and SharePoint.

This approach will let you create a form that is aware of a user's identity (login name, phone number, display name, etc.) and then allows you to filter a list in SharePoint to only show items that are relevant to them. 

Part 1: Find Out Things About Somebody

The first part requires SharePoint Portal Server unless you want to write your own web service.

§         Create or modify your InfoPath solution. 

§         Make sure that the data source for the form contains all of the fields that you want to store about the user (e.g. DisplayName, WindowsAccount, Title, email, PhoneNumber, etc.).  Make sure you have at least an “alias” field.  This will be the field on which the query is based.

§         Then add a new data connection by selection Data Connections from the Tools menu. 

§         Click Add,

§         choose Receive Data, click Next,

§         choose Web Service, click Next

§         For the URL specify http://[MyPortal]/_vti_bin/UserProfileService.asmx?WSDL where [MyPortal] is the name of your SharePoint Portal Server 2003 instance.

§         Choose GetUserProfileByName, click Next

§         Don’t specify a value for the input parameter, click Next

§         Deselect “Automatically retrieve data when form is opened”, click Finish

 

Now you are ready to query the web service and map return values to values in your form. If you haven’t already laid out your form, do so, and make sure to include the alias form field.    Add a button next to the alias form field.  Double-click on the button to go to its property dialog.  Click on the Rules button.  Set the condition to be when the alias field is not blank.  Add an action to set the value of the secondary data source’s query field to be equal to the value of the alias field.  Add another action for each of the fields you want to map where you set the form field’s value equal to the value of the return set.  Make sure that you store the AccountName return value, this will be the basis of your SharePoint filter.

 

Publish the form solution to a SharePoint Form Library and make sure to promote the fields to SharePoint columns that you want to appear in SharePoint (at least promote the field storing AccountName as this will be the basis of the filter).

Step 2: Filter the List Based On The Current User

As you may already know, SharePoint lists can be filtered to show information based on the current user using the [Me] filter in the list properties.  However, this only works for list columns controlled by SharePoint.  If you want to filter lists based on the current user using information in other columns (e.g. the columns coming from a InfoPath form), this requires a different method.  Based on the information from the Microsoft knowledgebase article, "How to use a URL to pass parameter information with an SQL query for a data source by using FrontPage 2003 and Windows SharePoint Services" you can specify a list to filter on the full domain\username of a user.  By default Current User or UserID uses the friendly version of the username.  Therefore, if you try to filter a list using the WindowsAccount Equals [Current User] approach you will receive an empty list.

Here is the relevant information from the article:

2.                  On the Data menu, click Filter.

3.                  Click Click here to add a new clause.

4.                  Modified Step:  Click the field that you promoted to a column from the InfoPath solution from the Field Name column.

5.                  Click Equals in the Comparison column.

6.                  Click [Current User] in the Value column.

7.                  Click OK.

8.                  In the lower right corner of the edit window, click Code.

9.                  On the Edit menu, click Find.

10.              Type Name="UserID" Location="CAMLVariable" in the Find What box, and then click Find Next.

11.              This will find the following line of HTML code:

 <ParameterBinding Name="UserID" Location="CAMLVariable" DefaultValue="CurrentUserName"/>

12.              Change the line of HTML code to the following:

 <ParameterBinding Name="UserID" Location="ServerVariable(LOGON_USER)" DefaultValue="[ LOGON_USER ]"/>

13.              Save the page, and then click Preview at the bottom of the edit window.

Part 3: Validating

§         Fill out a form,

§         specify your own alias,

§         lookup your information using the button,

§         save it to the SharePoint Form Library,

§         do this again only using a different user’s alias,

§         visit the filtered view, and confirm that only your form shows up.

 

If you have any problems or if this process isn't clear, leave a comment.

More Posts