infopath 2010 data connections and rules
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 PresentationTRANSCRIPT
INFOPATH 2010DATA CONNECTIONS AND
RULES
Tom CastigliaHershey Technologies
[email protected]: @tomcastigliawww.hersheytech.com
www.sanspug.org
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)
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
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.
InfoPath Data Connections
The “plumbing” in your InfoPath form
Allows you to configure the
connections between back-end systems and your form’s UI.
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
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
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
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
Demo Time
Show Me…
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
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.
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.
Data Connection Tip #4 You can specify default values for the input
parameters of your data connections, if user input is not required.
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.
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
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
Data Connection Tip #8Unlike regular Data Connection
Libraries, you cannot re-use existing connections in the CMCL on different forms!
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
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>
</newLine></linebreaks>
Questions ??? …Tom CastigliaHershey [email protected]@tomcastigliawww.hersheytech.comwww.sanspug.org