Another Live InfoPath Project

"The beast is finally tamed" – Ohhh! I still remember this sentence. This was once said by my PM (Athar Shafiq – Xavor) when we completed the Portal migration project (SPS 2003 to MOSS 2007) for Broadcom, US. The relevance of this sentence is very much the same today as I have completed yet another huge & difficult project in MOSS 2007 which was based on InfoPath Form Services having worth 900 USD and was scheduled to complete in one month’s time and By the Grace and Blessing of Allah I was able to do fully deliver it as per the schedule and below is the feedback from the client who gave me 5.0 rating out of 5.0 J

"This gentleman had excellent skills sets has it has to do with programming SharePoint Infopath and web services. This gentlemen was paid in other methods for a very complex InfoPath project. What I found most important in a good programmer is that he has tenacity to get the job done. He worked with me feverishly while there was a 6.0 earthquake in his country. My hat is off to this Muneeb for his programming skill set and his tenacity to get the job done."

Project Details:
The project was for doctors who wanted their patient examination form to be electronically submitted to their fully developed portal which is based on MOSS 2007. Therefore, the best option was to use InfoPath form services. Furthermore, some requirements logically came to one outcome to publish the form as content type and to make the form web browser enabled. In a nut shell, the form was browser enabled and must be published as a new content type in MOSS.

Limits and Limitations: When I was in Abu-Dhabi, someone told me that, "When we talk about limits, we also talk about limitations". Same was the case with this project; since the scope of the project was limited therefore there were few limitations as well which were introduced by the InfoPath, which were as follows.

  • Required to export the form in simple text file.
  • Client required tabs in InfoPath forms which InfoPath don’t have.
  • Since the form was browser enabled & published as CT, therefore, NO code was allowed inside the form.
  • There were few rules inside the form which required permission handling. Example: Hiding the form from all other except authors on certain conditions.

To overcome this scenario, I had to bind an event handler with the form library which makes some decision based on data inside the form and export data its data. Furthermore, on specific form statuses, permission and rules of the form gets changed, therefore, the project had three sections (InfoPath Form itself, One custom web-service, Event Handler).

As we know, that usergroup.asmx web-service’s schema needs to modify so that it can return proper values when used with InfoPath forms, so to avoid this customizations everything I change its reference, I wrote custom web-service to use usergroup.asmx web-service and this custom WS was called from InfoPath form.

Now something about form tabs. As we know that inside InfoPath there is no such control, therefore, I have to make something which looks like tab control therefore, I manage it with Buttons, Sections, Rules and hidden control fields. This was a very difficult part of the project.

Finally about event handler: I used event handler primarily for two purposes

  1. To modify permissions after item is added (which is based on form status which is present inside the form).
  2. To export form’s data in a simple text file which must be available to users for download.
Since, the event handler acts after item is added to the form library, therefore, all fields of the form can be read when you treat this form as an item (rather XML file). So I used System.IO to read the contents of the XML file (InfoPath Form) therefore, to export form data we can read all its fields and put them in a text file which is then attached to an item of another support list (a custom list with attachment field).
Here are few snapshots!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: