infopath set a field's Value - InfoPath Dev
in

InfoPath Dev

infopath set a field's Value

Last post 10-28-2011 11:33 AM by Glebron. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 10-28-2011 10:05 AM

    infopath set a field's Value

    Ok So I have a form that I use. I have a dropdown field linked to an external data Srouce and based on what the user chooses it populates the address fields, Work fine Now I trying to edit the form and add more fields to populate using Set a Field but, it wont work I even delete the current one and added a new one the same exact way and still nothing... only thing i can see is the xpath is diffrent for some reason but it looks the exact same Fx...

    Works  

    xdXDocument:GetDOM("ARCustomer")/dfs:myFields/dfs:dataFields/d:ARCustomer/@AddressLine1[../@Name = xdXDocument:get-DOM()/my:assetTracking/my:employee/my:BillToName]

     Dont Work

    xdXDocument:GetDOM("ARCustomer")/dfs:myFields/dfs:dataFields/d:ARCustomer/@AddressLine1[xdXDocument:GetDOM("ARCustomer")/dfs:myFields/dfs:dataFields/d:ARCustomer/@Name = BillToName]

     but its the same Line...  @AddressLine1[@Name = BillToName]
    Gabriel Lebron
    Network Admin

    [email protected]

    Integra Companies, Inc.
    29 Saratoga Blvd
    Devens MA 01434
    www.integracompanies.com

  • 10-28-2011 10:14 AM In reply to

    Re: infopath set a field's Value

    But it is not the same. The filter is quite different:

    [../@Name = xdXDocument:get-DOM()/my:assetTracking/my:employee/my:BillToName]

    vs.

    [xdXDocument:GetDOM("ARCustomer")/dfs:myFields/dfs:dataFields/d:ARCustomer/@Name = BillToName]

    In the first sample, you are already at the AddressLine1 attribute in your XPath, and then you go back up to the ARCustomer node (..) and select the Name attribute. There is an equal sign, and then the full XPath to the BillToName field in the main data source.

    In you second sample, you are already at the AddressLine1 attribute in your XPath, and then use the full XPath to select the Name attribute. However, that full XPath will always select the first name attribute (I'm assuming that ARCustomer is repeating). The BillToName field is not in the ARCustomer data source - and is also lacking its namespace prefix.

    Hilary Stoupa

  • 10-28-2011 10:57 AM In reply to

    Re: infopath set a field's Value

    Hmmm. I think i understand what you mean. But I dont know how to write code so i rely on Insert Formula.  any reason why the out put is not the same is there a setting i am missing.

    All i am doing is inserting a field or group  button and picking my fields is there something i am doing wrong?

    Gabriel Lebron
    Network Admin

    [email protected]

    Integra Companies, Inc.
    29 Saratoga Blvd
    Devens MA 01434
    www.integracompanies.com

    Filed under:
  • 10-28-2011 11:08 AM In reply to

    Re: infopath set a field's Value

    So you are getting this result with insert field or group? That's odd. I'd expect you to get the first result.

    You need to use insert field or group, then add a filter to the field you select (using the filter button). Select the name field from your secondary data source, then "is equal to" and finally, the main data source field you are comparing to.

    Hilary Stoupa

  • 10-28-2011 11:33 AM In reply to

    Re: infopath set a field's Value

    Well doing it that way worked Great... I wasnt using the Filter button .. thank so Much

    Gabriel Lebron
    Network Admin

    [email protected]

    Integra Companies, Inc.
    29 Saratoga Blvd
    Devens MA 01434
    www.integracompanies.com

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