July 2009 - Posts - Ernesto Machado
in

InfoPath Dev

Ernesto Machado

July 2009 - Posts

  • Conditional SQL mapping with DBXL v2.3

    This blog entry assumes you have completed tasks 1, 2, 3 and 5 in the DBXL Getting Started document. In other words, I assume that you have already:

    1. Configured an InfoPath form to submit to the DBXL web service.
    2. Created a document type in DBXL using that form.
    3. Added SQL mapping.
    4. Successfully submitted documents and verified their shredding.

    Though we can always add validation in the InfoPath form to prevent users from submitting with blank fields, we can also prevent DBXL from shredding certain documents. We call this conditional mapping.

    For example, the Expense Report sample that ships with InfoPath 2007 (and is used in the Getting Started document) does not require the user to enter a Purpose. Suppose we don’t want to map documents that have a blank Purpose. In this case, we don’t want the second row in our database, because of the blank Purpose field.

     

    So we must resort to conditional SQL mapping. For this particular example, this means “let’s only send this data to SQL when a certain field is not NULL”.

    Only one small change needs to be made in the mapping. Where we previously had this:

    And now we change to:

    We manually added a condition in the note path for the table: /my:expenseReport[my:purpose != ""]. We empty our SQL table and click the Reshred All button in DAT, and we obtain the following data shredded into SQL:

     

    So we have successfully filtered on the xpath, excluding (from SQL) rows where the Purpose field is blank.

  • qRules v1.7 sample form

    After installing qRules v1.7 you can get a quick glimpse into some of the commands. Simply navigate to the installation folder (usually C:\Program Files\Qdabra Software\Qdabra Rules Library) and locate the qRulesForm.xsn. Right-click on that form template and select Design.

    You'll find that the form contains multiple views to illustrate the usage of the following commands:

    • CopyTable
    • MoveTable
    • DateDiff
    • Delete
    • IsDirty
    • SetDirty
    • ExecuteAction
    • GenerateGuid
    • GetErrorCount
    • Insert
    • Replace
    • SortTable

    Click Preview and test out the commands!

    If you want to see how the commands are configured, you can switch to the appropriate view in InfoPath's design mode and check the rules implemented in each button. Along with the qRules v1.7 User Guide, this will allow you to get these commands up and running in your own forms in no time!

    Posted Jul 29 2009, 10:00 AM by ErnestoM with no comments
    Filed under:
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.