Design a Form to Collect Customer Information Using InfoPath and SharePoint 2010

In this article, I am going to cover a scenario where a business would like to collect and maintain some information about their customers. To keep the example simple, we are going to use the following details/requirements:


  • Need a place for our salespeople to fill out our Customer Discount Form online
    • The current process is that the salespeople fill out a “pen and ink” form and fax it to our home office
  • The formula for customer discounts is as follows:
    • Customer is a veteran-owned business: 10%
    • Customer is a minority-owned business: 5%
    • Customer is a “Green Certified” business: 5%
  • We have chosen InfoPath and SharePoint 2010 as our toolset for this solution

    First things first, we need to design our form in InfoPath 2010. Start InfoPath Designer 2010 and design the form, including the fields you need. An example of what this particular form might look like appears below.

    As you can see, I have included the following controls in the form:

    The next thing that we need to do is take care of the two fields/controls on the list that will not be filled out by the user, setting the submitDate to “Today” and calculating the totalDiscount field.

    By right-clicking the Date Picker control and selecting “Properties”, we get the control properties dialog, which looks like this:

    Select the “function” button, which is circled in red in the image above. You should now be looking at the “Insert Formula” dialog.

    Select the “Insert Function” button, which is circled in red above, and then select the “Date” category and “today” function. This will set the field to automatically populate with today’s date when the form is opened.

    Click “OK” twice and you are done. Now, let’s take a look at calculating that totalDiscount field. The first thing we need to do is create a Group for all of our discount controls. Do this by right-clicking the “myFields” node in the Fields pane and select “Add”.

    Select “Group” for the Type field and enter a name. Right-click each of the discount fields in the Fields pane, select “Move”, select the “Discounts” node and click “OK”. Now, we are going to add 3 hidden fields that are going to house the current values for the three discounts, based on the user’s selections. We do this by right-clicking the “Discounts” group node and then selecting “Add”.

    Create three hidden fields of type “Text (string)” each with a default value of 0 and with the following names:

    The next thing we need to do is set up some rules, so that when the user makes a change to the checkboxes, the values will change. To do this, we are going to perform the following tasks for all 3 checkboxes.

    First, select the check box and then click the “Manage Rules” icon in the ribbon. This will show the Rules pane. Now, click the “New” button and add an “Action” rule.

      123
      0 Comments  (click to add your comment)
      Comment and Contribute

       

       

       

       

       


      (Maximum characters: 1200). You have 1200 characters left.

       

       

      Networking Solutions

      Partners

      More Networking