3. Editing List Input Forms
As with most
applications, managers often request at least one feature that generally
requires costly customization. A software platform can provide a
thousand features, but one department’s managers will focus on a
customization they think they must have but which is either not
available or is cost prohibitive to provide.
Prior to SharePoint 2010,
the process of customizing list input forms was a grueling, cumbersome
task and required SharePoint Designer or a custom Web Part. SharePoint
2010 makes editing the input forms easier by utilizing the InfoPath
platform. The Ribbon for the list includes a section called Customize List, shown in Figure 3.
There are four icons in this section, which assist the content or developer in modifying the input forms. Table 3 lists these icons with descriptions of each.
Table 3. Icons for Modifying Input Forms
ICON | DESCRIPTION |
---|
| The Customize Form
icon allows a content administrator to use Microsoft InfoPath 2010 to
create custom forms to add or edit items in the list. |
| The Modify Form Web Parts icon allows a user to edit the default form Web Part and Web page using a Web browser interface. |
| The Modify
Form In SharePoint Designer icon quickly opens the form in SharePoint
Designer 2010. You use SharePoint Designer to edit list settings, add or
remove columns, and create new views, forms, workflows, and custom
actions. |
| The Create Quick
Step icon allows you to create a custom Ribbon button to perform a
custom action on a list. Creating a Quick Step will add a button to the
Quick Steps group on the Items tab. |
3.1. Modify Form Web Parts
You can make traditional Web Part
changes to a new list form or edit the form within the Web browser. A
content administrator can click the Modify Form Web Parts icon and
select the appropriate form to edit. In the following example, the steps
show you how to edit a new form and rearrange the Web Parts on the
screen.
Click the Modify Form Web Parts icon and select Default New Form.
The Web Part property page opens, as shown in Figure 4,
and you can use its options to make changes to the appearance, layout,
and other advanced features. Under Advanced Features, a new option
exists called Show Toolbar With Ribbon.
When you are finished making changes to the Web Part, click OK.
In the Ribbon, click Stop Editing.
3.2. Modify Form Using InfoPath 2010
Microsoft InfoPath 2010 can
now be used to modify the list forms. Within a few minutes a new,
customized form is created, which allows form content to be grouped
logically depending on form requirements. In SharePoint Server 2007,
InfoPath forms were cumbersome to create and maintain; however, with
SharePoint 2010, modifying
the look and feel of a form to comply with user requirements is easy.
For example, generally when a start and end date is required on a form,
it is easier for the user to fill out the form when the two date columns
are side by side. The following process explains the steps you would
use to move the End Date next to the Start Date in a list form.
Go to the SharePoint list and click the Customize Form button in the Ribbon.
Microsoft InfoPath 2010 will open to allow edits to the new form. Figure 5
shows a default list edit form. In the right pane you see the fields
available to place on the list. Making edits in the form is as easy as
creating a new row or column and dragging fields to the form with the
mouse.
Make any additional changes to the page design by clicking the Page Design tab, as shown in Figure 6.
You can modify the colors, fonts, and styles used in the page design as
needed or required, similar to how you modify a spreadsheet in Excel.
When
you have completed the changes you want to make, you should save the
template and verify it for validity. To verify, click the File tab at
the top of the page to open the Form Information panel. Click the Design
Checker icon as shown in Figure 7 to verify the form contents and layout. After you run the Design Checker, control is returned to the form view (shown in Figure 5)
and any errors are listed in the right pane. Fix the errors identified
by the Design Checker, if there are any, and then return to the File tab
to save and publish the form. If you are publishing more than one form
type to a list or library, use Save As so the other forms are not
overwritten.
Publishing
the form to SharePoint is as easy as clicking Publish Your Form. The
SharePoint site is updated and all references to the Edit Form will now
refer to the newly created list template. An example modification to the End Date field is shown in Figure 8. Notice that the Start Date and End Date fields are now located in this Project Information - New Item form.
If you see the error message when you try to publish a modified form, the SharePoint 2010 State Service is not created:
"The form cannot be rendered. This may be due to a misconfiguration of
the Microsoft SharePoint Server State Service. For more information,
contact your server administrator."
One possible cause for this
error could be that the SharePoint 2010 farm was created manually
without running the farm Configuration Wizard.
To configure the SharePoint 2010 State Service using Windows PowerShell commands, complete the following steps.
Open a browser and go to the SharePoint Central Administration website. On
the taskbar, click Start, select Administrative Tools, and then select
Windows PowerShell Modules. This will start Windows PowerShell and load
all associated SharePoint modules. In the Windows PowerShell window, create a service application by typing the following command. $serviceApp = New-SPStateServiceApplication -Name "State Service"
Create a State Service database and associate it with a service application by typing the following command. New-SPStateServiceDatabase -Name "StateServiceDatabase"
-ServiceApplication $serviceApp
Create a State Service Application Proxy and associate it with the service application by typing the following command. New-SPStateServiceApplicationProxy -Name "State Service"
-ServiceApplication $serviceApp -DefaultProxyGroup
This will create the State Service service application, and InfoPath published forms should render properly. If you still see error
messages when running custom forms, verify that the Web application is
associated with the State Service service application.
|
3.3. Modify Form Using SharePoint Designer 2010
SharePoint Designer 2010
enables power users and developers to customize solutions—with little or
no coding—that work for a variety of common scenarios ranging from
collaborative sites and Web publishing to line-of-business integration,
business intelligence, and human workflows. In this latest release,
SharePoint Designer 2010 has been greatly enhanced and it is important
to understand the changes in the new version. Features such as
Contributor Settings, Database Interface Wizards, and Site Publish,
Backup, and Restore no longer are available in SharePoint Designer 2010.
Additionally, SharePoint Designer 2010 offers new features such as the
ability to create Web Part Pages, master pages, lists, and workflows;
setting permissions for individual users; and saving and deleting site
templates, to name just a few.
In addition to the changes
mentioned, you can extend the SharePoint 2010 Ribbon using standard
development APIs to fulfill application and corporate requirements using
SharePoint Designer 2010 or Microsoft Visual Studio 2010. You can
customize both Ribbons and drop-down lists to display site lists,
available Web Parts, workflows, or other information as needed.
As in other Microsoft Office 2010 products, Quick
Steps can be created to execute a mini-workflow process. To create a
Quick Step in the Ribbon that will update the full name of a contact if
one hasn’t been entered, complete the following steps.
Create a new contact list or open an existing contact list and click List under List Tools in the Ribbon.
In
the Customize List section of the Ribbon, you will see icons that
reflect the different actions available to customize the form. Refer to Table 1-7 for a description of the icons and their functions. To create a Quick Step, click the New Quick Step icon.
SharePoint
Designer 2010 will automatically open and prompt you for the SharePoint
site credentials. Enter an appropriate login and password.
SharePoint
Designer will then ask if you want to start a new SharePoint workflow
or an existing workflow on the Add A Button page, as shown in Figure 10.
Select the option to Start A New Workflow.
In the Button Label text box, type a label for the button you want to create.
Choose
an image from the site. For example, you could use the Recycle Bin
image at /_layouts/images/fgimg.png. You can click the Browse button to
look for other images or type a path to the image you want to use
directly in the Button Image text box.
The
new Button Design page displays. The controls on this page will be
similar to Microsoft Visual Studio Workflow. Using the workflow example
as a guide, shown in Figure 11,
create the workflow steps using the Condition, Action, and Step tabs in
the Ribbon. This workflow will update the full name of a contact if one
hasn’t been entered on a list item.
Save
and publish the workflow as a new Quick Step. You will see the new
Quick Step icon in your list when you click the List Tools – Items Tab.
The new Quick Step icon will be located in the Quick Steps section of
the Ribbon, as shown in Figure 12.
To
execute the new Quick Step, select the check boxes to the left of the
list items you want to update and then click the new Quick Step icon.
After the Quick Step has completed, a new field in the list will appear.
In Figure 12, the new column name is called Button – UpdateFullName.