Again i have been off for few days from my blog, now i am here writing about a coolest feature of InfoPath 2010 for SharePoint 2010. That is creating SharePoint List Form. In Simple word to modify the new item form on the List.
So the ingridents are,
1. InfoPath 2010
2. SharePoint 2010 running somewhere on your domain.
and the Recipe is
Create a List named as Today Sale, I want some changes in its item creation form,
now open InfoPath 2010, Select SharePoint List in the Popular Form Templates
next in the Data Connection Wizard, provide the path of site in my case it is http://sp2010/, in the next step choose Today Sale in the Customize an existing SharePoint List
click finish to end this wizard.
Form open in the below format .
now we have to bind the Current User Username with the title, so first you have to make a Data Connection which fetch the details of current user.
In the Infopath Ribbon select Data, choose Data connection, click on Add
Click on the Receive data as done in the above .
Select SOAP Web Service as done in the above click next, in the next step, provide the path SOAP Web Service of UserProfile, it resides at http://ServerName/_vti_bin/UserProfileService.asmx. Then Click Next.
Choose the operation GetUserProfileByName as it is done in the above picture. Click Next on following screen as well and then click finish to end this wizard.
Now then, it is time to add the essential ingredient, bind the field with the current user info.
Right click on the Title field, go in to the text box property, click on fx as in the below picture
Click on the insert Field or group
Click on advance view in the Select a Field or Group. Now in the Fields drop down select GetUserProfileByName. expand the below tree and select value as it is done in the below picture,
click on the Filter Datat after selecting Value.
now Click add to add a filter. In order to specify the filter condition, choose the Select Field or Group
Choose Name under the Property Data, as it is done below
and then click OK.
now back on the Specify Filter Condition dialogue Box, Expand the third drop down list and Select Type Text. This Drop down now act as Text Field, now a very important note here your have to provide the require profile property in my i want username so enter UserName (Case Sensitive ) in the Text Field. Now Click Ok 5 times to close all the boxes 🙂
now we are back on the form, let’s do some garnishing on this form 😀
Delete the 2nd row of attachment as i dont want this, now you can preview the form.
I guess now it looks fine to me, so publish it right away. Now go onto your Today Sale list in your SharePoint site and click on the
add new item. you will get the following screen.
To end it on a learning note, below are the profile properties,
have a nice week-end, and happy coding and Sharepointing 😀