control default value of section based on variable - InfoPath Dev
in

InfoPath Dev

control default value of section based on variable

Last post 08-03-2006 05:02 PM by trufooser. 7 replies.
Page 1 of 1 (8 items)
Sort Posts: Previous Next
  • 08-01-2006 10:45 AM

    control default value of section based on variable

    well, I am still working on this orthopedic note generator. For each type of exam, (ankle/foot, elbow, knee, hip) I have a repeating section. Right now, the default value of the sections are set to not show on start-up.

    On a previous page, the user selects the problem areas (such as knee, hip, elbow, etc). Is there a way to control default value of these sections based upon the values of the previous selections?

    I am also using controlled visibility, but this wont work as all the sections have carefully selected default values that will be submitted to the database unless the arent instantiated.

    Thanks.
  • 08-01-2006 11:54 AM In reply to

    Re: control default value of section based on variable

    I'm guessing it is something similar to this post

    http://www.infopathdev.com/forums/topic.asp?TOPIC_ID=282

    however, I am a code moron and have no idea where to insert this code.
  • 08-02-2006 06:51 AM In reply to

    Re: control default value of section based on variable

    Are you are wondering how to populate a lot of default data?

    I would have a default record in your tables that would be used as a template. So if knee was selected it would load the default knee template information and then the orthopedist could modify it from there. You may need a secondary data connection to load these depending on your data structure.
    I would create some flag fields to pass the selections from view to view if necessary to control the visibility and the default data selections.
  • 08-02-2006 07:23 AM In reply to

    Re: control default value of section based on variable

    I have all the default values set up. I have two views, New_Visit view, and Exam_View. On the New_Visit view, I have a picture of a skeleton and where the user clicks on the skeleton logs it into a field.

    On the Exam_View, I have all the different Exams the surgeon can perform. Right now, none of them are instantiated (instantiated meaning, there are is no record for any type of exam, they need to click the insert record button) by default. What I want is if the user clicks on the Knee in the New_Visit view, a new record for Knee_Exam opens up in the Exam_View.

    Hope this clarifies things.....
  • 08-03-2006 03:15 PM In reply to

    Re: control default value of section based on variable

    So you want to automate the new record button essentially? I am not sure there is a way to do this in the form, it would probably take some code. but i have had similar needs to automatically begin a new record after i have queried another record as a template but i have not figured out the best practice for this.
    I do not have an answer on how to query a database connection and then reset it to allow a new record (without the user using the New Record button and setting the form back to the begining) nor how to take an existing record as a template, change the values including ID and submit it as a new record within Infopath without custom code. I always seam to get an error but hopefully someone else might know and post a solution. Even a best practice from a code sample would help people I am sure.
  • 08-03-2006 03:59 PM In reply to

    Re: control default value of section based on variable

    i guess basically what i want is instead of clicking on the "insert record" text underneath the table, you click a button and it inserts a new record.
  • 08-03-2006 04:36 PM In reply to

    Re: control default value of section based on variable

    Yes, you can do this, you must just write the code behind the button to do the insert. Then you will have full control over where the new row inserts, what data is contained in it, etc.
  • 08-03-2006 05:02 PM In reply to

    Re: control default value of section based on variable

    are there samples of code available as I have no jscript experience.

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