Infopath 2010 Data Connections and Rules

21
INFOPATH 2010 DATA CONNECTIONS AND RULES Tom Castiglia Hershey Technologies [email protected] Twitter: @tomcastiglia www.hersheytech.com www.sanspug.org

description

Tom Castiglia Hershey Technologies [email protected] Twitter: @ tomcastiglia www.hersheytech.com www.sanspug.org. Infopath 2010 Data Connections and Rules. Agenda. Using Data Connections and Rules to connect InfoPath forms to custom services or existing services Intro (slides) - PowerPoint PPT Presentation

Transcript of Infopath 2010 Data Connections and Rules

Page 1: Infopath  2010 Data Connections and Rules

INFOPATH 2010DATA CONNECTIONS AND

RULES

Tom CastigliaHershey Technologies

[email protected]: @tomcastigliawww.hersheytech.com

www.sanspug.org

Page 2: Infopath  2010 Data Connections and Rules

Agenda Using Data Connections and Rules to

connect InfoPath forms to custom services or existing servicesIntro (slides)Demo – Completed AP Invoice Approval

formDemo – How to configure rules and data

connections to create formReview 10 tips (slides)

Page 3: Infopath  2010 Data Connections and Rules

Target Audience Middle Tier Developers

Expose your middle tier business logic as a service (cloud or on-premise)

Use InfoPath as a RAD tool to easily build web UIs that can easily consume your custom services

End-Users, Business Analysts & IT staffUse InfoPath as a RAD tool to easily build web

apps and forms that can easily consume existing services

Page 4: Infopath  2010 Data Connections and Rules

What is InfoPath? Form Design tool Form Filler tool Forms Services for browser based form Rules and Data Connections to create

rich, functional forms for sending and receiving

Can be used in lieu of custom application development/Visual Studio to create moderately rich web-apps.

Page 5: Infopath  2010 Data Connections and Rules

InfoPath Data Connections

The “plumbing” in your InfoPath form

Allows you to configure the

connections between back-end systems and your form’s UI.

Page 6: Infopath  2010 Data Connections and Rules

Types of Data Connections

• SOAP• REST• WCF• Azure

Web Services

• SQL Server• ODBC• OLE-DB• Oracle

Databases

• SharePoint• File serverXML files

• Convenient alternative to using a database table

SharePoint lists / libraries

Page 7: Infopath  2010 Data Connections and Rules

InfoPath Rules Rules are like the application programming logic for

your form Rules can be used to…

Pass form data as an input parameter to a data connection Bind the data connection’s return values to other form

fields

Page 8: Infopath  2010 Data Connections and Rules

Types of Rules• Specify an error message that will be

displayed condition is falseValidation

• Changes “look and feel” of the UI elements (show/hide, color, fonts, etc.)Formatting

• Connect data connections to your form fields• Set input param values from form fields• Assign results from back to the fields

Action

Page 9: Infopath  2010 Data Connections and Rules

Why use Data Connections & Rules? Build rich, functional applications without code Common examples:

Populate a drop-down field

with values.

Generate unique,

incrementing ID values

Pre-fill portions of the form with

existing data

Send data to back-end

databases and applications

Perform real-time validations

of user input

Incorporate forms into workflow

processes

Page 10: Infopath  2010 Data Connections and Rules

Demo Time

Show Me…

Page 11: Infopath  2010 Data Connections and Rules

Data Connection Tip #1

• Limited to tables and views• Cannot call a stored

procedure directly

Database connection

s

• Requires a developer to implement services

• WCF is “best-practice”

Web Service

connections

Page 12: Infopath  2010 Data Connections and Rules

Data Connection Tip #2 When connecting to WCF services, typically use

the “Receive data” option. (Even if your service is used to save, update or delete

data.)

Use “Submit data” only when you want to submit (and close) the entire form.

Page 13: Infopath  2010 Data Connections and Rules

Data Connection Tip #3 When connecting to a WCF service, select the option

called “SOAP Web service”.

This applies to any type of service that has a WSDL file (SOAP, WCF, Azure, Java)

You must know the URL for your WSDL if you select this option.

Page 14: Infopath  2010 Data Connections and Rules

Data Connection Tip #4 You can specify default values for the input

parameters of your data connections, if user input is not required.

Page 15: Infopath  2010 Data Connections and Rules

Data Connection Tip #5 Uncheck the option to “Automatically

retrieve data…”

This option is checked by default. Leave enabled if the data connection does

not require user input.

Page 16: Infopath  2010 Data Connections and Rules

Data Connection Tip #6

This allows connections to be re-used on multiple forms

Prevents security warnings from being displayed when form is used

Start by setting up data

connections

Save connections to a Data Connection

Library

Approve the Data

Connections in the library

Page 17: Infopath  2010 Data Connections and Rules

Data Connection Tip #7Move Data Connections to Central Admin Connection

LibraryEasiest way to deal with migrating between Dev/QA/ProdThis requires forms to be published as an ‘Admin-

Approved’ form.Steps…

○ Export UDC files to local folder○ Open in Notepad and edit settings○ In Central Admin, navigate to GENERAL

SETTINGS>INFOPATH FORMS SERVICES>MANAGE DATA CONNECTION FILES

Page 18: Infopath  2010 Data Connections and Rules

Data Connection Tip #8Unlike regular Data Connection

Libraries, you cannot re-use existing connections in the CMCL on different forms!

Page 19: Infopath  2010 Data Connections and Rules

Data Connection Tip #9When using the result from one

query as the input into another query, create multiple rules rather than multiple actions in the same rule.

If a single rule contains multiple query actions, a race condition may occur causing the second query to fail intermittently

Page 20: Infopath  2010 Data Connections and Rules

Data Connection Tip #10To insert line feeds into data (e.g. to format an address), create a “New Line” XML data connection<?xml version="1.0"?><linebreaks> <newLine>&#xA;</newLine></linebreaks>

Page 21: Infopath  2010 Data Connections and Rules

Questions ??? …Tom CastigliaHershey [email protected]@tomcastigliawww.hersheytech.comwww.sanspug.org