Working with InfoPath Forms and InfoPath Services
Its long time, I’m out of my blogging service, just because of the fact I didn’t get enough time to share with you people my findings. Anyways, new twist in life and I’m back. Before I would take you towards my post, I would like to share a though with all of you! Here it is…
"LIFE IS LIKE A CUP OF COFFEE, YOU SIT BY THE WINDOW, TAKE A CARELESS SIP AND FIND NO SUGAR. TOO LAZY TO GO FOR THE SUGAR, YOU SOMEHOW MANAGE WITH THAT SUGARLESS BITTER CUP. ON FINISHING YOU DISCOVER UNDISSOLVED SUGAR CRYSTALS SETTLED AT THE BOTTOM… THAT’S HOW LIFE IS….. WE DO NOT MAKE ANY EFFORT TO VALUE OURSELF WITHOUT KNOW WHAT IS AROUND AND WITHIN OURSELVES. SO LOOK AROUND MAY BE THE SWEETNESS YOU ARE LOOKING FOR IS CLOSER THAN YOU THINK…….J"
Anyways, let me carry on with my today’s blog post. My today’s focus is on INFOPATH FORMS, PROMOTING FIELDS FROM INFOPATH FORMS AND PUBLISH THE FORM AS CONTENT TYPE. I hope this post will be helpful for you people.
The company in which I’m currently employed wants there business processes to get automated. One of the business processes is EXPENSE REIMBURSEMENTS. Let me explain a little. Employee fills a form and then it first goes to team lead (TL) for approval and if he approves it then it goes to Manager Finance in accounts department. Form looks something like this.
- Field indicated in Red above (Let me name them as well), "EMPLOYEENAME AND EMPLOYEEID" were supposed to come from AD and should be loaded from on form load. These fields are read only as well, so that if any employee fills a form its filled in with his/her name and ID, and read only field are required so that these cannot be changed.
- Total Due Amount against this reimbursement should appear in view.
- Bills/receipts should be attached as well.
- This form should appear in browser so that user can fill it there (InfoPath’s visual fidelity should be presented with zero footprint on the client)
- Design your form in Microsoft Word and then import it using InfoPath wizard. (Open InfoPath, you will see an IMPORT INFOPATH FORM on left side, then select "InfoPath Importer for Word Documents", browse to word document and then click FINISH) OR you can directly start designing it in InfoPath
- From the Menu click VIEW à DESIGN TASKS then click DESIGN CHECKER and then CHANGE COMPATIBILITY SETTINGS.
- Check the check box "DESIGN A FORM TEMPLATE THAT CAN BE OPENED IN A BROWSER OR INFOPATH", this will enable the users to open and fill this form in InfoPath without any footprints of InfoPath on the client end.
- For Repeating tables (with X number of Rows and Y no of Columns) use control REPEATING TABLE from Controls submenu. You will find this submenu inside Design Checker.
- Form should look something like this
- Now when you are finish with designing the form, its time to publish it. But before publishing, lets name the fields which we would like to show in our views.
- In my case these are (Name, DueAmount). So first let me name these textboxes. Double click a textbox and set its name, here you can also set different properties like setting a formula, Data Type, Multiline, Cannot be blank, or Read Only.
Ohhh! I almost forgot, to get data (EmployeeName and EmployeeID) on form load, we need to go through these steps. One way is to write a code on form load event which can prove futile for developer new to InfoPath services. Other way (easy way and involved NO CODE) is to call a web service (Provided by Microsoft J) and it will return you the required fields. Here are the steps… Please see this blog for more support [http://blogs.microsoft.co.il/blogs/itaysk/archive/2007/04/05/InfoPath-_2D00_-Get-the-current-user-without-writing-code.aspx]
Click DataSource (Sub Menu in Design Tasks) on bottom right you will find a link "MANAGE DATA CONNECTIONS à ADD à CREATE A NEW CONNECTION TO, (select radio button RECEIVE DATA) à CLICK NEXT à GIVE THE NAME OF WEB SERVICE http://yourportalname/_vti_bin/UserProfileService.asmx?WSDL à CLICK NEXT à SELECT GET USER PROFILE BY NAME à CLICK NEXT à CLICK NEXT à CLICK NEXT à CHECK THE CHECKBOX SHOWING AUTOMATICALLY RETRIEVE DATA WHEN THE FORM IS OPENED (Make sure about this) à FINISH AND THEN CLOSE"
DOUBLE CLICK THE TEXTBOX IN WHICH YOU WANT TO GET VALUES à CLICK THE FUNCTION BUTTON AND ADD THESE LINES IN FORMULA TEXTBOX à CLICK OK à CLICK OK.
concat(Value[Name = "FirstName"], " ", Value[Name = "MiddleName"], " ", Value[Name = "LastName"])
YOU ARE DONE WITH GETTING DATA ON FORM LOAD. YOU CAN ADD DATA TO ANY TEXT BOX.
Please find the step-by-step snapshots below!
Now let’s publish the form. GOTO FILE à PUBLISH à SELECT TO A SHAREPOINT, SERVER WITH OR WITHOUT INFOPATH FORM SERVICES à CLICK NEXT à GIVE THE NAME OF YOUR SERVER à CLICK NEXT à CHECK ENABLE THIS FORM TO BE FILLED OUT IN BROWSER, ALSO SELECT SITE CONTENT TYPE (ADVANCE) à CLICK NEXT à HERE SELECT AN EXISTING CONTENT TYPE TO UPDATE OR CREATE A NEW ONE à CLICK NEXT à CLICK ADD TO ADD FEW FILEDS WHICH NEEDS TO BE PROMOTED (THESE FIELDS CAN BE USED IN WORKFLOWS OR TO SHOW IN LIST VIEWS) à CLICK NEXT. You are DONE!!!
[InfoPath is great for building forms, but what about deployment? Not all of your customers will have access to the InfoPath client application—and they won’t have to. InfoPath Forms Services, which is built on top of SharePoint Server 2007, uses SharePoint document libraries, content types, permissions, and administration to deliver an integrated forms-management package. Moreover, Forms Services is designed to extend the reach of your forms. Not only does it support Microsoft Internet Explorer® on Windows, it can also serve forms to Netscape and Firefox for UNIX and Windows, and even Firefox and Safari for the Macintosh, and it can render content for mobile devices such as Smartphones and PDAs] Ref: http://msdn.microsoft.com/en-us/magazine/cc163562.aspx
- Posted in: SharePoint