16.01.2013 Views

Microsoft Sharepoint Products and Technologies Resource Kit eBook

Microsoft Sharepoint Products and Technologies Resource Kit eBook

Microsoft Sharepoint Products and Technologies Resource Kit eBook

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 39: Using <strong>Microsoft</strong> Office InfoPath with SharePoint <strong>Products</strong> <strong>and</strong> <strong>Technologies</strong> 1065<br />

In the form template, an OnLoad() event h<strong>and</strong>ler checks whether the user is<br />

online, calls a GetMyProfile() method to obtain all information related to the user,<br />

<strong>and</strong> then programmatically prepopulates the appropriate form fields with this<br />

information.<br />

The illustration of this process is shown on Figure 39-15, as follows:<br />

F39XR15<br />

1. A user starts InfoPath in the Fill Out Form mode <strong>and</strong> points to the form template<br />

in the form library on the SharePoint site. Alternatively, the user can click<br />

Fill Out Form on the form library’s page.<br />

2. The form is downloaded to the client computer <strong>and</strong> put in the local cache.<br />

3. InfoPath opens the form <strong>and</strong> executes OnLoad() event h<strong>and</strong>ler that calls the<br />

GetMyProfile() method of the Profile Web Service on the SharePoint Portal site.<br />

4. The required data is returned to InfoPath. The form fields are populated with<br />

the returned data, <strong>and</strong> the form is displayed to the user.<br />

5. The user fills out the rest of the form <strong>and</strong> saves it back to the form library.<br />

InfoPath in<br />

the Fill Out<br />

Form mode<br />

1<br />

5<br />

3<br />

2<br />

4<br />

SharePoint Portal Server<br />

Windows SharePoint Services<br />

Form<br />

Library<br />

Profile Web<br />

Service<br />

User profile<br />

database<br />

Figure 39-15 Prepopulating InfoPath form with data from user profile database<br />

More Info For a working code sample that shows prepopulating an InfoPath<br />

form with the data exposed by a custom Web service on portal site, plus a<br />

detailed explanation of this code, refer to the article “Integrating <strong>Microsoft</strong><br />

SharePoint <strong>Products</strong> <strong>and</strong> <strong>Technologies</strong> <strong>and</strong> <strong>Microsoft</strong> Office InfoPath 2003,”<br />

located at http://msdn.microsoft.com/library/default.asp?url=/library<br />

/en-us/odc_sp2003_ta/html/sharepoint_integrating_sps_<strong>and</strong>_infopath.asp.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!