programming4us
programming4us
WEBSITE

Microsoft SharePoint 2010 : InfoPath Forms Services - Responding to Events in InfoPath Forms (part 1) - Using the Rules Engine

- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019

Carrying on with our Equipment Request form, let’s look at how we can hook up the buttons on the form using a few methods that follow.

Using the Rules Engine

The easiest way to handle events in an InfoPath form is to use the built-in rules engine. Three different types of Rules can be applied to a control or field:

  • Validation Allows users to add a validation formula to a field or control. Where the validation formula does not return true, a user-defined message is displayed.

  • Formatting Formatting works a bit like conditional formatting in Excel. The user can define a condition or formula that must evaluate to true or false. If the formula evaluates to true, the format is applied.

  • Action Within InfoPath most event handling is done using Action rules. By using Action rules, a user can perform a series of actions when a specified condition occurs. Some examples of a condition that can trigger an action rule are Field Changed and Button Clicked.

We’ll make use of an Action rule to switch to our Customer Search view when the Find Customer button is clicked on our form:

  1. If you haven’t already done so, switch back to the default view: in the Page Design tab of the ribbon, select View 1 (default) from the View drop-down. Then click the Find Customer button.

  2. From the Properties tab’s Button section of the ribbon, select Rules. You’ll see the Rules pane on the right side of the page.

  3. Select New | Action from the Rules pane, and then type the rule name as Do Customer Search.

  4. In the Run These Actions section, click Add |Switch Views, and then select Customer Search Results from the list of views.

  5. As well as showing our search results page, we need to perform the actual query. This time select Add | Query For Data, and then select the Customer data connection from the list.

We can now publish this form and see the results using the browser. When the user clicks the Find Customer button, a list of customers is displayed, allowing the user to select an appropriate record. The next step is to copy the selected customer details into our main form and then switch back.

  1. In the Page Design tab of the ribbon, switch to the Customer Search Results view, and then highlight the Select button.

  2. From the Properties tab on the ribbon, click Add Rule | When This Button is Clicked | Set A Field’s Value.

  3. In the Rule Details dialog, set the Field to the CompanyName field on the Main data source, as shown. The selector can be accessed by clicking the down-arrow button at the right of the Fields text box.

  4. Set the Value to the CompanyName field of the Customer data source. Again this can be done by clicking the down-arrow button to the right of the text box. Click Insert Field Or Group on the Insert Formula dialog that appears to show the selector.

  5. Repeat this process to copy all fields from the d:Customer group into the Customer group of the main data source. Rather than using the Add Rule button in the ribbon, which will create a new rule, you can add an additional action to the current rule by choosing Add | Set A Field’s Value from the Rules pane.

  6. After all the field values are copied, switch back to default view. From the Rules pane, click Add | Switch Views and set the view to View 1.

We can now publish the updated form and navigate to the document library to see the fruits of our labor. This time, when you click Find Customer and select a customer from the list, the details are copied into our main form and the search view is hidden from view.

Other  
  •  Microsoft SharePoint 2010 : InfoPath Forms Services - Accessing Data in InfoPath Forms (part 2) - Data Connection Libraries, Modifying UDC Files
  •  Microsoft SharePoint 2010 : InfoPath Forms Services - Accessing Data in InfoPath Forms (part 1)
  •  Extra-Curricular Activity - BMW 218d Active Tourer SE - An Engine That’s Fit For A Juke - Nissan Juke Tekna DIG-T (Part 1) - BMW 218d Active Tourer SE
  •  The Porsche Macan S Diesel 3.0 V6 – The Ultimate SUV You Can Drive (Part 2)
  •  Sharepoint 2010 : InfoPath Forms Services - InfoPath Overview (part 5) - Using InfoPath Forms in SharePoint - Creating Document Information Panels
  •  Sharepoint 2010 : InfoPath Forms Services - InfoPath Overview (part 4) - Using InfoPath Forms in SharePoint - Adding Formulae to Fields, Publishing a Form Template to SharePoint
  •  Sharepoint 2010 : InfoPath Forms Services - InfoPath Overview (part 3) - Using InfoPath Forms in SharePoint - Creating Form Templates
  •  Sharepoint 2010 : InfoPath Forms Services - InfoPath Overview (part 2) - BrowserForm Web Part
  •  Sharepoint 2010 : InfoPath Forms Services - InfoPath Overview (part 1)
  •  Sharepoint 2013 : List and library essentials - Sorting and filtering lists
  •  
    Top 10
    Free Mobile And Desktop Apps For Accessing Restricted Websites
    MASERATI QUATTROPORTE; DIESEL : Lure of Italian limos
    TOYOTA CAMRY 2; 2.5 : Camry now more comely
    KIA SORENTO 2.2CRDi : Fuel-sipping slugger
    How To Setup, Password Protect & Encrypt Wireless Internet Connection
    Emulate And Run iPad Apps On Windows, Mac OS X & Linux With iPadian
    Backup & Restore Game Progress From Any Game With SaveGameProgress
    Generate A Facebook Timeline Cover Using A Free App
    New App for Women ‘Remix’ Offers Fashion Advice & Style Tips
    SG50 Ferrari F12berlinetta : Prancing Horse for Lion City's 50th
    - Messages forwarded by Outlook rule go nowhere
    - Create and Deploy Windows 7 Image
    - How do I check to see if my exchange 2003 is an open relay? (not using a open relay tester tool online, but on the console)
    - Creating and using an unencrypted cookie in ASP.NET
    - Directories
    - Poor Performance on Sharepoint 2010 Server
    - SBS 2008 ~ The e-mail alias already exists...
    - Public to Private IP - DNS Changes
    - Send Email from Winform application
    - How to create a .mdb file from ms sql server database.......
    programming4us programming4us
    programming4us
     
     
    programming4us