Auto fill fields from drop down issue - InfoPath Dev
in

InfoPath Dev

Having trouble finding a blog or post that answers your question? Check out our Custom Search Page

Auto fill fields from drop down issue

Last post 08-23-2012 06:00 PM by dsanchez. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 08-16-2012 08:07 PM

    Auto fill fields from drop down issue

    Hi guys, been a while since I've been in here but came across something which requires the assistance of the gurus! :)

    Sorry if this is posted in the wrong area, but mods please feel free to move it if required

    I was successfully able to utilise the auto fill fields function from a drop down which was attached to a sharepoint library list. So whenever an item is selected from the drop-down list box, I was able to auto-fill fields on my form with data corresponding to the selected item in the drop-down list box. Example is shown below. Click on the fruit, and it should show the colour etc

     

    I was able to incorporate this on my form fine. Each drop down would correctly display the information it related to for a single record. I then realised the user may be required to enter more than 1 record, so I created a repeating function.

    This is where the functionality fell over, for 1 record without using the repeating function (i.e. Add new item) the records would show the correct data. As soon as another record was added the auto fill function would not work as it should. By clicking on a few of the options within the drop down, the lookup seems to stop working, it displays wrong information or it just doesnt recognise the command. In most cases the new record replicates the original entry and does not change the data even when a new drop down list entry is selected.

    I used this link to set up the auto fill procedure and it works 100% for just 1 record lol .. Anything else added after this and it goes haywire.

    So has anyone come across this happening before, or a solution as to how to get around this? In most cases users will definitely be using more than 1 record so I would really love to get this working properly.

    Many thanks

    Sanchez 

  • 08-17-2012 08:01 AM In reply to

    Re: Auto fill fields from drop down issue

    What is the rule you have on your field that is setting the other field? Or default value, if that is what you are using instead? When you look at the value in the formula editor, check the edit XPath button and paste the full XPath into a reply - I'm going to bet your formula is not using current()....

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

  • 08-19-2012 06:38 PM In reply to

    Re: Auto fill fields from drop down issue

    The full xpath formula is below: (please note that this is from my form so the field names are obviously different from the example)

    xdXDocument:GetDOM("ExpenseClaimsCostCentre")/dfs:myFields/dfs:dataFields/dfs:ExpenseClaimsCostCentre/@AccountName[../@ID = xdXDocument:get-DOM()/my:expenseForm/my:paymentDetails/my:paymentDetailsRS/my:costCentreCode]

    You are correct though as there is no reference to the current() function

  • 08-23-2012 12:06 AM In reply to

    Re: Auto fill fields from drop down issue

    Hate to bump this but any feedback?

  • 08-23-2012 03:11 AM In reply to

    Re: Auto fill fields from drop down issue

    Where are you using that formula.  Is it in a rule on the dropdown, or is it the formula in a calculated value box?

     If it's the former, try this:

    xdXDocument:GetDOM("ExpenseClaimsCostCentre")/dfs:myFields/dfs:dataFields/dfs:ExpenseClaimsCostCentre/@AccountName[../@ID = current()]

    If it's the latter, try this:

    xdXDocument:GetDOM("ExpenseClaimsCostCentre")/dfs:myFields/dfs:dataFields/dfs:ExpenseClaimsCostCentre/@AccountName[../@ID = current()/my:costCentreCode]

    Jimmy Rishe / Software Developer / InfoPath MVP
    Qdabra Software
  • 08-23-2012 06:00 PM In reply to

    Re: Auto fill fields from drop down issue

    Cheers Jimmy... it was the former. The rule was on the dropdown and as both you and Hilary pointed out, the current function was required. I added it into the formula and it worked fine!

    Many thanks to you both

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