Sharepoint 2010 : InfoPath Forms Services - InfoPath Overview (part 4) - Using InfoPath Forms in SharePoint - Adding Formulae to Fields, Publishing a Form Template to SharePoint

8/12/2014 9:17:50 PM
Adding Formulae to Fields

Our Item data element contains two columns, LineTotalCost and LineTotalValue, that should be calculated based on the values entered in other columns in the row. To add formulae for these fields, take the following steps:

  1. Select the Line Total Cost text box in the repeating table control. From the Properties tab in the ribbon, select Default Value.

  2. In the Field Or Group Properties dialog, click the fx button next to the Default Value text box.

  3. Using the Insert Field or Group button to select the appropriate fields, add this formula, as shown next: Quantity * StandardCost.

  4. Repeat the process for the Line Total Value text box. This time add this formula: Quantity* ListPrice.

  5. To prevent users from entering values in these calculated fields, we need to change them from text boxes to labels. Click the Change Control option from the Properties tab on the ribbon, and then select CalculatedValue.

Publishing a Form Template to SharePoint

Our basic Demonstration Equipment Request form is now complete. To publish it to SharePoint and use it for capturing data for our Demonstration Equipment Request library, take the following steps:

  1. As we did earlier, from the backstage area, click Publish Form To A SharePoint Library. Type the server URL as http://<YourServerName>/Chapter5. When prompted, save a copy of the form named EquipmentRequest.xsn to the local file system.

  2. Select Form Library from the list of options, and then select the Demonstration Equipment Requests library. Click Next to move to the next step of the wizard.

  3. When we published our simple form earlier, we skipped this section. Since we want to capture data from our equipment request form, we need to specify which fields we want to include as columns in our document library. By clicking the Add button in the upper section of the form, add all fields within the Customer group to the library, as shown:

  4. Click Next and then click Publish to add the form to our library.

Using the browser to navigate to the Demonstration Equipment Requests library, you can see that by clicking the New Document button on the Documents ribbon, our InfoPath form is displayed, allowing us to enter details as expected. To store the form in the document library, we must use the Save option and name the form. By performing this step, we’re saving a copy of the form in the document library and at the same time copying the field values that we specified earlier into columns.

Creating Custom Forms for SharePoint Lists

Another use of InfoPath forms, and one that’s become more prevalent with SharePoint 2010, is in the creation of custom new and edit forms for SharePoint lists. Custom forms differ from the form templates that we saw earlier: the form itself is not stored in the library. Since custom forms can be used only with lists, only the field data that we elect to include is copied to columns in the list as opposed to the entire completed form. Let’s create a custom form for a SharePoint list:

  1. Using SharePoint Designer, create a new custom list named MyCustomList. From the Lists and Libraries navigator, double-click the MyCustomList icon to manage the settings for the list.

  2. In the List Settings tab of the ribbon, select Design Forms in InfoPath | Item. InfoPath Designer will then open, displaying a basic template for capturing list item data.

  3. Additional fields can be added using the Add Field link in the Fields pane. When you add a field to the form, a column is also added to the underlying list to store the captured data. For example, we could add a field named Description. Once the form is published, a new column named Description will be added to our custom list.

  4. To publish the customized form, click Info in the left pane and then click the Quick Publish button in the backstage area:

  •  Sharepoint 2013 : List and library essentials - Sorting and filtering lists
  •  Sharepoint 2013 : List and library essentials - Using list and column validation rules
  •  Sharepoint 2013 : List and library essentials - Editing and deleting list columns
  •  Sharepoint 2013 : List and library essentials - Creating list columns
  •  Sharepoint 2013 : List and library essentials - Adding and editing list items
  •  Sharepoint 2013 : Farm Management - Disable a Timer Job,Start a Timer Job, Set the Schedule for a Timer Job
  •  Sharepoint 2013 : Farm Management - Display Available Timer Jobs on the Farm, Get a Specific Timer Job, Enable a Timer Job
  •  Sharepoint 2013 : Farm Management - Review Workflow Configuration Settings,Modify Workflow Configuration Settings
  •  Sharepoint 2013 : Farm Management - Review SharePoint Designer Settings, Configure SharePoint Designer Settings
  •  Sharepoint 2013 : Farm Management - Remove a Managed Path, Merge Log Files, End the Current Log File
    GTS - youtube channel
    Video tutorials
    - How To Install Windows 8

    - How To Install Windows Server 2012

    - How To Install Windows Server 2012 On VirtualBox

    - How To Disable Windows 8 Metro UI

    - How To Install Windows Store Apps From Windows 8 Classic Desktop

    - How To Disable Windows Update in Windows 8

    - How To Disable Windows 8 Metro UI

    - How To Add Widgets To Windows 8 Lock Screen

    - How to create your first Swimlane Diagram or Cross-Functional Flowchart Diagram by using Microsoft Visio 2010
    programming4us programming4us