Autofill feature - InfoPath Dev
in

InfoPath Dev

Autofill feature

Last post 01-06-2011 08:25 PM by Patrick Halstead. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 12-28-2010 06:46 AM

    Autofill feature

    I am creating some new forms. When the users fill out the first form , they save it. Then, I have a header section (header, as in , a section at the start in each form that has the same information) in every other form that should be automatically be pulled from the first form. What is the best way to go about this. The first form has a unique field. Should I search for those fields that I need to autopopulate , on the basis of the unique field in the first form? Can someone describe a good method to set up autopopulating a header section.
  • 01-06-2011 07:56 AM In reply to

    any ideas for this, yet
  • 01-06-2011 08:11 AM In reply to

    Where is your first form storing its data?

    Generally, you need for any form that pulls info from a data source to be set up to query the data source and then copy the information into the correct fields. The specifics of how to approach this depends on factors like where the data comes from, what versions of InfoPath (and SharePoint, if that is part of your solution) you are using, and so on.

    Hilary Stoupa

  • 01-06-2011 09:24 AM In reply to

    First of All, Thank you for your time, Hilary, really appreciate it.

    Q. Where is your first form storing its data?

     A. SharePoint 2007

    For example, the first form has a unique identifier called: DNumber. When the first form (lets call the first form , the CENTRAL form) is submitted, the value in this field gets submitted to Sharepoint List. All other forms have a similar field that will have this unique value in a field, just that the fieldname will be different.

    What I want to be able to do is that, this field (the unique identifier) should autopopulate in all other forms when they are opened from the first form.

    How can I do that? I had tried to set it up in a way that worked but, with a catch. So when the CENTRAL form opens it stores 2 pieces of information in hidden fields, username and substring(now(),1,16) When the Form1 Button is clicked on the CENTRAL form, it opens Form 1 and fetches the DNumber from the sharepoint list, filtered by the username and timestamp obtained by substring(now(),1,16. The problem with this method is that sometimes the username and/or the timestamp function does not work if the computer is slow or sharepoint server is slow and then autopopulation does not work. (9 out of times it will work, but you know how it is tough to convince users, even if the errors comes up just 1 out of 10 times) I wonder if the solution might be generation of a random number. Is there a way to randomly generate a unique number in infopath? I am primarily using Infopath 2007 , but I also have Infopath 2010 on another computer (still learning though).

  • 01-06-2011 08:25 PM In reply to

    Hi TechPundit,

    We have a training module that specifically talks about how to populate fields from another form. There are many techniques. You seem to be following the "Config File" paradigm. Your first form is config data for your other forms. Easy to do this. Check out Mel's blog for more info: http://www.infopathdev.com/blogs/mel_balsamo/archive/2010/12/11/free-training-data-driven-design-using-xml-files-to-configure-other-forms-lab-2.aspx. If you have a lot of data and you are worried about pulling in to much data, you are not using the "config file" paradigm but rather just an XML-to-XML business process with input parameters. We have training on that too. You can pass parameters to a new InfoPath forms from your first form using qRules in combination with the input parameters format for InfoPath (http://server/site/library/forms/template.xsn?a=1&b=2 where template.xsn is your target destination form and 'a' and 'b' become the parameters. qRules allows you to read those and set fields in your form. Worfklow can do this too but it is asynchronous and may not be a good user experience (since it doesn't open on click, but you could prepop target forms I suppose).

    To generate a unique identifier, qRules has a command called GenerateGUID that you can use. You could also use date-time stamp and user but as you say this isn't guaranteed for browser-based forms. 

     

     

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