DBXL database mapping - InfoPath Dev
in

InfoPath Dev

DBXL database mapping

Last post 11-18-2010 08:21 PM by Jim Cantwell. 8 replies.
Page 1 of 1 (9 items)
Sort Posts: Previous Next
  • 11-15-2010 08:02 AM

    DBXL database mapping

    Hi,

    Just wondering, how are database mappings in DBXL detected? My form has 3 sections where each section is exclusive to each other (meaning each section serves an independent function, for example, create approval form, delete approval request and modify request form) and when triggered by their respective button clicks, will allow users to fill in the section details. Each form then has the same "main submit" button to complete and submit the form.

    I've tried mapping each section to their individual database tables in DBXL with some success. It seems that DBXL is able to detect if a section is filled and only insert fields into the "active" section. Meaning, if I created a form to create an approval request, the delete and modify tables will not have anything inserted as their form sections are empty. This was a pretty amazing feature until I further developed my form and experienced a situation where my form cannot be reshredded because of some key value (from another section) being empty. Problem is, it should be empty as I did not "activate" that section.

    So I am puzzled if anyone knows which field or key values is the trigger for DBXL to map form data to database columns? To simplify, I have a form with 3 sections, each mapped to a different database table. I wish to be able to fill in any section of the form, submit form data and ONLY trigger the database map to the correct table while ignoring the other 2 database table mappings. This is possible right? I know I have to figure out the trigger else my form will either fail to reshred or start mapping to additional tables which I do not want.

    Any ideas for my puzzle?

    -

  • 11-15-2010 09:29 AM In reply to

    You should make your shredding conditional using the Node Xpath at the Table level

    Example:

    /my:myFields/my:CreateSectionInfo[/my:myFields/@my:SubmitType='Create']

     

  • 11-16-2010 03:00 AM In reply to

    Hi Jim,

    Currently I have something like this, /my:myFields/my:Form_Container/my:CreateGroup as my node path to my table. Are you saying I can alter it to this: /my:myFields/my:Form_Container/@my:CreateGroup='1'

    Where '1' can be a hidden field(creategroup) value and when I click on my submit button I can set a value for creategroup and subsequently DBXL will shred to the database where the node path is @my:CreateGroup='1'?

    This sounds good! If it is how I understand it to be...

  • 11-16-2010 03:52 AM In reply to

    Yes, you can use the table's XPath to conditionally include or not include certain rows (or all rows) during shredding, but your path doesn't make sense.  It would be more like:

    /my:myFields/my:Form_Container/my:CreateGroup[@my:create = '1']

    Where @my:create is an attribute field on the my:CreateGroup node.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 11-16-2010 03:59 AM In reply to

    Hi Jimmy,

    Yup, I figured that out regarding the [] and yes it worked! This is a very useful feature, how come they didn't mention this conditional shredding in the user manual? Or did I miss it?

    Anyway, rem my previous xpath? Where it ends with a ignore empty node condition? my:Manager_Engagements_NotGrouped[. != '']

    Can I incorporate conditional formatting on my node path as well? Something like .......my:Manager_Engagements_NotGrouped[. != ''][@my:create = '1'] ??

    Haven't tried this myself yet, still figuring out how to transfer checked MSLB values to each other and refreshing the form view without committing the changes to database...

  • 11-16-2010 04:26 AM In reply to

    Yes, you can combine conditions like that.  Should work just fine.

     I'm not sure if the manual mentions this conditional mapping, but we do have a few blog posts on the topic.

    http://www.infopathdev.com/blogs/david/archive/2007/10/17/conditional-shredding-in-dbxl.aspx

    http://www.infopathdev.com/blogs/ernesto/archive/2009/07/31/conditional-sql-mapping-with-dbxl-v2-3.aspx

    I will ask the support team whether the manual has any reference to these, and will ask them to add it if not.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 11-16-2010 10:38 AM In reply to

    Hi, yes our documentation does include some information about conditional shredding.

    If you look at our "How To" guide for database mapping there is a section on conditional mapping:

    http://www.infopathdev.com/files/folders/database_integration/entry56213.aspx

    Ted

  • 11-18-2010 07:23 PM In reply to

    Hi Guys,

     Just wondering, am I supposed to add the '@' symbol as well? Because when I do that, my document can't be reshredded. I had to use this for my nodepath: /my:myFields/my:Form_Container/my:CreateGroup/my:CreateGroupContainer[my:New_GroupCode!= ''] then it works fine.

    Thanks for your help guys!

  • 11-18-2010 08:21 PM In reply to

    The '@' symbol would only be used if the New_GroupCode field is an attribute. 

Page 1 of 1 (9 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.