Simpo PDF Merge and Split Unregistered Version - http://www.simpopdf.com Electronic Forms WHAT’S IN THIS CHAPTER? ➤ Designing InfoPath Forms ➤ New features in InfoPath and InfoPath Forms Services 2010 ➤ InfoPath Best Practices ➤ Sandboxing Your InfoPath Forms ➤ Form Development Tools In today’s world, most business processes rely on capturing information from the end users and translating it into appropriate and timely actions A majority of these business processes simply start with a form and may use other forms throughout their lifecycle Unfortunately, in many cases forms are received with inaccurate information, which leads to bad decision making, significant cost, and damage to organizations SharePoint ships with a great object model that can be used to build sophisticated forms for gathering data and feeding it to the enterprise business processes, such as workflow sequences and composite applications The vision behind the product, as an application development platform, however, has always been based on its ability to build powerful enterprise applications quickly and easily The emphasis on the words easy and quickly in the product’s vision statement means that there should be an easier way to create, distribute, and manage electronic forms with little or no code InfoPath 2003 was Microsoft’s fi rst attempt to uniquely position this product to handle the problems in business data collection and presentation needs The main feature of InfoPath 2003 was the ability to author and render XML-based electronic forms with support for custom-defi ned schema InfoPath 2003 native support for XML made it a compelling solution for integration with many backend systems that can understand and communicate in XML In SharePoint 2003, a form library and its form template were designed to glue the two c09.indd 389 2/22/12 12:08:11 PM Simpo PDF Merge and Split Unregistered Version - http://www.simpopdf.com 390 ❘ CHAPTER ELECTRONIC FORMS products together Collectively, the form library and its template allowed customers to create new instances of a single form template and translate the field values into column values upon saving the form, all done within the context of a SharePoint site but fi lled out via the InfoPath 2003 client Because of some architectural and deployment limitations in InfoPath 2003, this product never achieved adoption beyond simple departmental solutions that allowed members of small teams to collect, route, and store data within their own little collaborative sandboxes But, how about the Enterprise? Not all users who interact with business processes have access to the InfoPath client application; neither they use one particular device, such as their computer, all the time! For example, sales agents need to take the forms offline and use their PDAs and smart phones to fi ll them out, partners use only their browser to interact with forms, and internal employees may use a combination of the InfoPath client and browsers to participate in various business processes across the enterprise When the Office 2007 suite hit the streets, Microsoft introduced a very exciting feature: Forms Services 2007 — included in the enterprise version of Microsoft Office SharePoint Server 2007 If you are interested in learning about electronic forms integration with Microsoft Office SharePoint 2007, Chapter 14 (by John Holliday) in the book Professional SharePoint 2007 Development (Wrox, 2007), is a great resource In a nutshell, Forms Services was all about allowing end users to use their browsers to fi ll out InfoPath forms and allowing administrators to manage those forms Form Services 2007 was a great move to help extend the reach of electronic forms by ensuring that electronic forms can render content for a wide range of users using various client applications and different devices The concept of content types and their association with form templates, two-way synching between form data fields and columns, and a better deployment model were all among major improvements Microsoft made to the product at that time With the power of the SharePoint Server 2010 platform, InfoPath 2010 and Forms Services 2010 represent even more significant improvements over their predecessors Some of the improvements came from the core platform itself and some were made available in each product InfoPath 2010, available in the Professional Plus volume license SKU, is a form creation and datagathering tool that ships with the Microsoft Office 2010 package If we consider InfoPath 2003 Service Pack as a major iteration in the product’s lifecycle, then InfoPath, in its fourth iteration with the 2010 release, has evolved way beyond the product that was released back in August 2003 InfoPath 2010 is the most compelling release to date and is the quickest way to have a common form rendition in the browser as well as in rich and offline clients Once you install InfoPath 2010, the fi rst thing that you may notice is that InfoPath 2010 comes with two flavors: InfoPath Designer and InfoPath Filler InfoPath Designer 2010 is the primary tool used by designers to create and design the forms with easy-to-use features based on pre-built templates and baked-in functionalities As the name implies, InfoPath Filler 2010 comes with a Fluent UI, which provides a much improved and yet simpler end user experience for filling out forms c09.indd 390 2/22/12 12:08:13 PM Simpo PDF Merge and Split Unregistered Version - http://www.simpopdf.com Introducing the Training Management Application ❘ 391 The following list provides a sneak peek of some of the new features introduced in InfoPath 2010 and InfoPath Form Services 2010: ➤ Richer browser forms with shorter load time ➤ The capability to handle more requests per second ➤ The capability to customize SharePoint list forms ➤ A brand-new InfoPath Form web part ➤ Equal rendition across the major browsers Compliant browser forms (WCAG 2.0, XHTML 1.0, and strict CSS) ➤ Integration with Business Connectivity Services (BCS) ➤ Ability to query REST web services/ SharePoint REST APIs ➤ Native offl ine integration with SharePoint through SharePoint Workspace 2010 client ➤ New controls like the People/Group Picker, Date Time Picker, and Picture button ➤ On-premises or multi-tenant hosting support (i.e., SharePoint online) ➤ Ability to script various operations using PowerShell, backup, and restore ➤ Seamless integration with new Health Rule Defi nitions Enterprise forms is a broad topic that could make up several chapters, if not its own book However, after reading this chapter, you will have a good understanding of how to leverage InfoPath in SharePoint to rapidly design and create forms used in enterprise management processes across your organization And with that, it is time to get started INTRODUCING THE TRAINING MANAGEMENT APPLICATION In this chapter, you’ll use an example of a Training Management application at a fictitious company, Adventure Works, which illustrates some of the new capabilities of InfoPath 2010 and Forms Services 2010 First, take a look at how this application works from the user’s perspective The Human Resources (HR) department at Adventure Works uses SharePoint and InfoPath to implement a training-course system You can think of the Training Management application as a set of three use cases as follows: ➤ New training creation use case ➤ Training registration use case ➤ Increment stat counter use case As illustrated in Figure 9-1, Adventure Works staff can perform various activities in this application For example, the training coordinator can create trainings and add them to a SharePoint list named Trainings This list will be customized and enhanced by InfoPath 2010 to facilitate the training creation use case c09.indd 391 2/22/12 12:08:23 PM Simpo PDF Merge and Split Unregistered Version - http://www.simpopdf.com 392 ❘ CHAPTER ELECTRONIC FORMS Also, the Human Resources department at Adventure Works allows its employees to register for a training opportunity The training registration form is designed in InfoPath and hosted inside the new InfoPath Form web part on a web part page named Trainings Dashboard The training registration form must be rendered in a typical desktop web browser and in browsers on handheld or mobile devices Once a training request is fi lled out and saved, the result is stored in a form library named Registrations, and an event handler associated with the Registrations form library fi res and updates a counter in another custom SharePoint list, named Stats The Stats list is hidden from employees so that its content can’t be modified and it does not clutter navigation At the end, the registration form is connected to the Stats list through the web part connections framework in SharePoint to demonstrate a simple form-driven mashup scenario As you may notice, the primary forms in driving the business process just described are all electronic forms and implemented in InfoPath 2010 The following diagram demonstrates a high level overview of the Training Management application Stats (Custom List) U pd at e: Ev en tH an Add & Edit Add & Edit dl er Trainings (Custom List) Training Creation Form Training Coordinator Registrations (Form Library) Query & Filter using REST or SharePoint Adaptor Registration Form Employees FIGURE 9-1 CUSTOMIZING SHAREPOINT LIST FORMS In Windows SharePoint Services 3.0, list forms were regular ASP.NET pages serving as the visual interfaces to add an item to, or edit or display an item in, that list Typically, list forms were defi ned in the list template and instantiated upon the creation of a new list instance Although c09.indd 392 2/22/12 12:08:24 PM Simpo PDF Merge and Split Unregistered Version - http://www.simpopdf.com Customizing SharePoint List Forms ❘ 393 there are several ways to replace the out-of-the-box list forms (DispForm.aspx, EditForm.aspx, and NewForm.aspx) with custom ASPX pages, as described in the following list, each approach introduces its own challenges: SharePoint Designer Customization: In this approach, you use SharePoint Designer 2007 to modify the layout of list forms and add custom business logic For example, you could create a new NewForm.aspx form from scratch This approach introduces a very limited customizability that limits you to using HTML, JavaScript, and Extensible Stylesheet Language (XSL) only Additionally, customizing list forms using SharePoint Designer 2007 results in inserting a fairly big chunk of XSL into the HTML markup of the form, which makes it even harder to maintain! Customizing List Forms via a Browser: You can add web parts to the Display, Edit, and New forms via a browser to add business logic for the inserting and editing of list item data The problem with this approach is that Microsoft clearly states that it is not supported, meaning that if something breaks you’ll have to remove the web part and leave the default List Form web part as the only web part on the page This is certainly not a solution that you can always rely on either Using Custom Content Types with Associated Custom Forms: This is a better approach than the other two, because you can use all your ASP.NET coding skill sets and deploy the list forms in a much cleaner way However, you cannot leverage this approach for the existing content types or lists that are not yours You must add to this the extra code that you would have to write to handle the CRUD (create, read, update, and delete) operations that your custom UI requires when interacting with lists, such as wrapping your calls to Update() methods in a try/catch block and trap for exceptions like concurrency violations and so on One of the exciting features in InfoPath 2010 is the ability to extend or enhance the forms used by SharePoint lists for creating, editing, or showing list items Today, you can modify list forms layouts, set validation rules, or create additional views using little or no code When you are fi nished modifying the list forms, reflecting your changes back to SharePoint is just a matter of using the one-click publishing capability that comes out of the box with the list form In this section, you will explore some of the new functionalities of InfoPath 2010 used to customize SharePoint list forms in the context of a Training Management application, which you will build throughout the chapter Creating the Trainings List Before diving into customizing the Trainings list forms using InfoPath, you need to create the SharePoint list and add the required fields to it Business requirements of the Training Management application dictate that the training coordinator be able to create new training opportunities by selecting Add New Item in the Trainings list This list resides on the Human Resources website and requires the following information: c09.indd 393 ➤ Title: A title for the training opportunity ➤ Code: A code that uniquely identifies the training (unique eight-character fi xed) ➤ Description: The description of the training 2/22/12 12:08:25 PM Simpo PDF Merge and Split Unregistered Version - http://www.simpopdf.com Related Wrox Books Beginning SharePoint Designer 2010 ISBN: 978-0-470-64316-7 Covering both the design and business applications of SharePoint Designer, this complete Wrox guide brings readers thoroughly up to speed on how to use SharePoint Designer in an enterprise You’ll learn to create and modify web pages, use CSS editing tools to modify themes, use Data View to create interactivity with SharePoint and other data, and much more Professional Business Connectivity Services in SharePoint 2010 ISBN: 978-0-470-61790-8 With this in-depth guide, a team of SharePoint experts walks you through the features of the new BCS, including the ability for users to view and modify the data from SharePoint 2010 with BCS You’ll explore how to use BCS, deploy solutions, create external content types and lists, create NET host connectors, and more Professional SharePoint 2010 Branding and User Interface Design ISBN: 978-0-470-58464-4 Creating a branded SharePoint site involves understanding both traditional web design techniques as well as topics that are typically reserved for developers This book bridges that gap by not only providing expert guidance for creating beautiful public facing and internal intranet sites but it also addresses the needs of those readers that only want to understand the basics enough to apply some style to their sites Professional SharePoint 2010 Administration ISBN: 978-0-470-53333-8 SharePoint 2010 boasts a variety of incredible features that will challenge even the most experienced administrator who is upgrading from SharePoint 2007 Written by a team of SharePoint experts, this book takes aim at showing you how to make these new features work right for you Real World SharePoint 2010: Indispensable Experiences from 22 MVPs ISBN: 978-0-470-59713-2 This book is a must-have anthology of current best practices for SharePoint 2010 from over 20 of the top SharePoint MVPs They offer insider advice on everything from installation, workflow, and web parts to business connectivity services, web content management, and claims-based security SharePoint Server 2010 Enterprise Content Management ISBN: 978-0-470-58465-1 If you’re interested in building web sites using the new capabilities of enterprise content management (ECM) in SharePoint 2010, then this book is for you You’ll discover how SharePoint 2010 spans rich document management, records management, business process management, and web content management in a seamless way to manage, and share content Simpo PDF Merge and Split Unregistered Version - http://www.simpopdf.com Try Safari Books Online FREE for 15 days + 15% off for up to 12 Months* Read thousands of books for free online with this 15-day trial offer With Safari Books Online, you can experience searchable, unlimited access to thousands of technology, digital media and professional development books and videos from dozens of leading publishers With one low monthly or yearly subscription price, you get: • Access to hundreds of expert-led instructional videos on today’s hottest topics • Sample code to help accelerate a wide variety of software projects • Robust organizing features including favorites, highlights, tags, notes, mash-ups and more • Mobile access using any device with a browser • Rough Cuts pre-published manuscripts START YOUR FREE TRIAL TODAY! Visit www.safaribooksonline.com/wrox20 to get started *Available to new subscribers only Discount applies to the Safari Library and is valid for first 12 consecutive monthly billing cycles Safari Library is not available in all countries badvert.indd 812 2/22/12 8:33:56 PM ... a SharePoint list named Trainings This list will be customized and enhanced by InfoPath 20 10 to facilitate the training creation use case c09.indd 391 2/ 22/ 12 12: 08 :23 PM Simpo PDF Merge and Split. .. of a new list instance Although c09.indd 3 92 2 /22 / 12 12: 08 :24 PM Simpo PDF Merge and Split Unregistered Version - http://www.simpopdf.com Customizing SharePoint List Forms ❘ 393 there are several... description of the training 2/ 22/ 12 12: 08 :25 PM Simpo PDF Merge and Split Unregistered Version - http://www.simpopdf.com Related Wrox Books Beginning SharePoint Designer 20 10 ISBN: 978-0-470-64316-7