XML-to-XML Mapping- Prevent submission to the target document type on first creation/submission of the host document type. - InfoPath Dev
in

InfoPath Dev

XML-to-XML Mapping- Prevent submission to the target document type on first creation/submission of the host document type.

Last post 11-30-2012 01:18 PM by DC Forms. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 11-26-2012 12:25 PM

    • DC Forms
    • Top 150 Contributor
      Male
    • Joined on 06-14-2012
    • Washington, DC
    • Posts 76

    XML-to-XML Mapping- Prevent submission to the target document type on first creation/submission of the host document type.

    I have an XML-to-XML solution that Ernesto assisted with the creation of. It is likely an unique business case- the target document type fields are not entered by users when the host document type form is initially created and submitted. It is not until an existing host form/record is edited by users that they enter data into the target document type fields.

    The issue is that a record containing NULL values is being inserted in the target document type's database table when the host document type form is created and submitted, since users are not entering information for the target document type. The creation of a NULL target form/record also occurs when users edit and existing form and change only the host document type form fields and do not enter information in the target document type fields.

    Note: Users do not edit target/child records. The business case is that users only add additional target/child records.

    Attached is a screen capture of the form for an existing parent record. The New Funding section contains the target document type fields. The Historical Funding section is displaying all the target document type/child records that pertain to the parent record. The first blank row in the Historical Funding table is a NULL child record.

    At the very least I need to prevent NULL child records from being displayed. Preferably, I need to prevent NULL child records from being created.


  • 11-26-2012 03:23 PM In reply to

    Re: XML-to-XML Mapping- Prevent submission to the target document type on first creation/submission of the host document type.

    If you have a required field in the child group, you can use a conditional SQL mapping. So, for example, if you have a my:Price under the repeating child group, you would set this up (manually, in DAT):

    my:RepeatingChildGroup[my:price != ""]

    I think this is covered in the DBXL training with some examples, but if you can't find it let me know.

    Could you try that out and see if the conditional SQL mapping prevents the NULL child rows?

    Let us know. Thanks.

    Ernesto Machado
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™


  • 11-30-2012 10:43 AM In reply to

    • DC Forms
    • Top 150 Contributor
      Male
    • Joined on 06-14-2012
    • Washington, DC
    • Posts 76

    Re: XML-to-XML Mapping- Prevent submission to the target document type on first creation/submission of the host document type.

    Ernesto,

    I've tried a conditional mapping and it did not work. I expect I am not using the correct XPath to the field "amount". (The field is required from a business perspective but not, yet, required by the form.)

    See the attached image.


  • 11-30-2012 10:45 AM In reply to

    • DC Forms
    • Top 150 Contributor
      Male
    • Joined on 06-14-2012
    • Washington, DC
    • Posts 76

    Re: XML-to-XML Mapping- Prevent submission to the target document type on first creation/submission of the host document type.

    FYI, the complete Node Path for the coditional mapping is: /my:historicalFunding[/my:funding/my:qdxtp_historicalFunding/my:Content/my:historicalFunding/my:amount != ""]
  • 11-30-2012 10:54 AM In reply to

    Re: XML-to-XML Mapping- Prevent submission to the target document type on first creation/submission of the host document type.

    I see that the node path for the table is

    /my:funding/my:qdxtp_historicalFunding/my:Content/my:historicalFunding

    In that case, the manual modification would be

    /my:funding/my:qdxtp_historicalFunding/my:Content/my:historicalFunding[my:amount != ""]

    Can you try that?

    Ernesto Machado
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™


  • 11-30-2012 01:18 PM In reply to

    • DC Forms
    • Top 150 Contributor
      Male
    • Joined on 06-14-2012
    • Washington, DC
    • Posts 76

    Re: XML-to-XML Mapping- Prevent submission to the target document type on first creation/submission of the host document type.

    Ernesto,

    /my:funding/my:qdxtp_historicalFunding/my:Content/my:historicalFunding[my:amount != ""] did not work. It prevented all child records from being created (when the user later updates the form and enters in child records).

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