Limiting the amount of rows and automatically populating fields... - InfoPath Dev
in

InfoPath Dev

Limiting the amount of rows and automatically populating fields...

Last post 11-24-2008 01:29 AM by pablavo. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 11-04-2008 01:30 PM

    Limiting the amount of rows and automatically populating fields...

     Hi folks, I hope can explain this well enough.

     The backend of the InfoPath forms I want to design is SQL Server.  There is specifically two tables, one called Projects and one called Milestones. Each Project can have 7 Milestones, each Milestone (steps) have 7 fields (Date1, Date2, Comment1 etc).

    The Project table is the parent table to Milestones as there can be 7 to each project.  On my InfoPath form I want to know if it's possible to have the 7 rows of fields on the form and no more? This is so the rows of fields are already layed out? 

    Each projects milestones are named differently (Project 1's first Milestone has a different name from Project 2's first milestone). For this reason, I'd like to know if there is a way to automatically populate the 7 rows with the correct name depending on which project is selected?  

    Hope that makes sense? I don't want users to be able to select more than 7 milestones but I want each row that makes up a milestone to be already populated with the milestone name (in the MilestoneName field)

     

    I'd be grateful if someone could help me with this. If you need more info, please let me know.

     

    Thanks

    ____________________________________

    Take a deep breath phsssssssssss
  • 11-04-2008 08:35 PM In reply to

    • Anuma
    • Top 25 Contributor
      Female
    • Joined on 07-20-2005
    • India
    • Posts 525

    Re: Limiting the amount of rows and automatically populating fields...

    Hi,

     

    To display the 7 rows by default for a repeating table, please follow the below steps:

    1. Open “mySchem.xsd” file in visual studia.
    2. Search for your Repeating group element.
    3. Change minOccurs and Max occurs maxOccurs value to 7
    4. Save and close the “mySchem.xsd” file.
    5. Now verify the form in preview mode. Bydefault 7 rows will be displayed and we can’t able to select more than 7 rows for a table.
     Where do you want to show the milestone name as "Project 1's first Milestone"? Is this displayed in the field or a label?
    Anuma Chinthapalli /
    http://www.GGKTech.com
  • 11-05-2008 12:37 AM In reply to

    EDIT: Limiting the amount of rows and automatically populating fields...

    I think there's a better way for me to explain this.

    I managed to change the MySchema.xdn file so the form would show 7 rows but when I try a rule to populate a field if the drop down is a certain value, all rows are populated with the same value and I'm still unsure how to populate each row with a specific value. (see explanation below)

    ********************

     

     tblProject has a one to many relationship with tblMilestone (4 projects each with 7 milestones. Projects1's first milestone name is different from Project2's)

    tblMilestone has these fields:
    MilestoneID(PrimaryKey), ProjectID(ForeignKey), MilestoneNameID(This is from a lookup table that has all milestone names. The MIlestoneNameID references this table) and 6 other fields date, comment etc.

     I'm still unsure about how to populate the 7 rows MilestoneNameID so the user doesn't have to. So, if all 7 rows were already on the form. I'd like for a user to use a drop down list to pick a project and the milestones names that related to that project would automatically populate each row in order (milestone1-row1 etc)

     Do you know if there's a way to do this.

     Again, thanks for all your help.

    ____________________________________

    Take a deep breath phsssssssssss
  • 11-21-2008 05:15 AM In reply to

    Re: EDIT: Limiting the amount of rows and automatically populating fields...

    To reach this, you need to do the following

    - Go to Menu Tools
    - Select Default Values
    - Select the repeating Node
    - Right Click and add another xxx below, do this 7x

    Then in each newly created node, you select the MilstoneNameId and set the Default Value.

    When testing the form, you will get the 7 rows populated with the default values

    Frederik Van Lierde

    Frederik Van Lierde
    Blue InfoPath Blog  ¦  SilverSands Associate  ¦  Do you follow me already?  ¦  We work smart, not hard


    If this article was helpfull, don't forget to rate it, tnx!
  • 11-24-2008 01:29 AM In reply to

    Re: EDIT: Limiting the amount of rows and automatically populating fields...

    Hi Frederik, Thanks for getting back to me.

     I looked at your technique, which will help to some extent, however, the problem is that the MilestoneNameIDs can change depending on the project drop down list. There are 4 projects and each one has its own set of MilestoneNameIDs. If I pick Project1, for example, the ID's that populate the 7 rows (or nodes) will be different if I picked project2.

     You wouldn't know how I could get round this? I think this might involve Xpath, however, I haven't really looked into Xpath yet and hope there's a work around.

     Hope you can help a little more.

    Thanks

    ____________________________________

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