210 likes | 353 Views
Tom Castiglia Hershey Technologies tcastiglia@hersheytech.com 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)
E N D
Tom Castiglia Hershey Technologies tcastiglia@hersheytech.com Twitter: @tomcastiglia www.hersheytech.com www.sanspug.org Infopath 2010Data Connections and Rules
Agenda • Using Data Connections and Rules to connect InfoPath forms to custom services or existing services • Intro (slides) • Demo – Completed AP Invoice Approval form • Demo – How to configure rules and data connections to create form • Review 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 staff • Use 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 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
Why use Data Connections & Rules? • Build rich, functional applications without code • Common examples:
Demo Time Show Me…
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
Data Connection Tip #7 • Move Data Connections to Central Admin Connection Library • Easiest way to deal with migrating between Dev/QA/Prod • This 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 #8 • Unlike regular Data Connection Libraries, you cannot re-use existing connections in the CMCL on different forms!
Data Connection Tip #9 • When 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 #10 To 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 Castiglia Hershey Technologies tcastiglia@hersheytech.com @tomcastiglia www.hersheytech.com www.sanspug.org