January 2012 - Posts - Ernesto Machado
in

InfoPath Dev

Ernesto Machado

January 2012 - Posts

  • Reusable Contact Selectors in InfoPath

    During Qdabra’s free weekly webinar on November 10, 2011, we discussed three possible contact selectors, their pros and their cons. This follow up blog post will summarize that webinar and provide you with XTP and XSN samples. You can download the supporting files here.

    One of the main concerns when using a contact selector is that it should be reusable. After all, you probably will need similar functionality in more than one form. Save time by creating an InfoPath Template Part (XTP) and simply injecting it into your InfoPath form template (XSN)!

    People picker

    Microsoft provides users with one such reusable contact selector. It’s called the People Picker and it’s available, out of the box, in InfoPath 2010.

     

    This is definitely one advantage: it comes with InfoPath, so there’s nothing to set up, and it will connect with your SharePoint server to find users.

    The disadvantage is that the schema is locked. When you add this control to your form, you’ll see that the nodes have a small padlock next to them, meaning that you cannot modify them. You also cannot add more fields under the repeating node (/my:myFields/my:group/pc:Person).

     

    You can perform some configuration on the control, such as allowing more than one user, but it’s not highly customizable.

     

    The control is browser compatible, and the sample form that we include in this package is as well. Simply publish the form to your SharePoint server to test it.

     

     

    Qdabra’s non-Active Directory Contact Selector XTP

    Going one step further we come to a contact selector that still obtains user info from SharePoint, but this one offers more flexibility. Notice that the schema is not locked, meaning that we can modify it as desired.

     

    The XTP uses a connection to SharePoint’s UserProfileService to obtain the user’s info.

     

    But this XTP also has its own drawbacks, namely: you’ll need to search for user's EXACT alias (there is no option for partial matches). In addition, there is no option to list all users. You search for a users alias, and select that user. In the example provided, we are also retrieving the user’s email address.


    This XTP uses qRules for some actions, though it would be entirely possible to build a simpler non-Active Directory XTP, without qRules. Therefore, the XSN included in this package is injected with a trial version of qRules. If you have purchased the qRules, you can reinject the XSN with the full version.

    The XTP is included in the downloadable package. To use it:
    1.    Create a new XSN form template and save it.
    2.    Inject your XSN with qRules.
    3.    Add the XTP to your Controls, and then insert the XTP your canvas.

    Once the XTP is on your canvas, you’ll see some configuration steps you’ll need to follow.


    Qdabra’s ContactSelector XTP

    The previous two XTPs did not query Active Directory, but Qdabra’s Contact Selector XTP does. Why Active Directory? The Active Directory web service allows us to list all users as well as search for partial matches, and the results provided by this web service contain a wealth of information about the users.

    It has been discussed in a previous blog post, explained in a video demo, and it is available for sale on Qdabra’s website. If you have any questions, please contact us at support (at) Qdabra (dot) com.

  • Extract Attachments from your InfoPath forms

    Imagine that you created an InfoPath form template where users can include an attachment. You published the form template to a SharePoint form library, and then your users submitted hundreds of forms. Each of those forms contains attachments, but those attachments are "stuck" inside your xml forms!

    Luckily, using the DBXL Migration Tool, you can extract those attachments from your InfoPath forms, and store them in a separate location.

    Qdabra Software has put together a package you can download, which includes a PDF guide as well as sample forms. To obtain it, simply click here.

  • InfoPath 2010 Data Connection Wizard issue when using QueryDB or QuerySharePoint

    When using QueryDB or QuerySharePoint in an InfoPath 2010 form, you might encounter behavior that is different from the behavior you are used to in InfoPath 2007.  When you get to the screen below, you enter values (per our previously documents for QueryDB and QuerySharePoint). If you click Back in the Data Connection Wizard, the values are removed.

    In addition, if you finish the Wizard, and set the data connection to execute on load, the data connection will fail in InfoPath 2010.

     

    This is something that changed from InfoPath 2007 to 2010.  InfoPath 2010 behaves differently for some data connections, including QueryDB and QuerySharePoint.

    In InfoPath 2007, you could:

    • Enter the Sample Value in the Data Connection Wizard.
    • Enter values in the following screen (labeled “Set Value”)
    • Set the data connection to run on load.
    • Preview the form and get results as expected.

    If you follow the same steps in InfoPath2010, the data connection may fail on load. Therefore, in InfoPath 2010, we recommend the following:

    • When you create the data connection to QuerySharePoint, set it to NOT execute on load.
    • In your form’s On Load rules, add a rule that will:
      • Set the value of the parameters (e.g. listUrl and query) using “Set a field’s value”.
      • Query using the data connection.


Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.