Applies To: Microsoft Office InfoPath 2003 SP-1 Preview
InfoPath SP-1 introduces a number of exciting new built-in controls. One of which is the Master/Detail control. After InfoPath 2003 was released, one of the most common questions on the InfoPath newsgroups was how to implement a Master/Detail type of control in InfoPath. Although this was possible in InfoPath 2003 prior to SP-1, doing so was not easy or straightforward. For this reason, InfoPath 2003 SP-1 now includes built-in support for the Master/Detail control.
The Master/Detail control allows you to designate one control as a master that drives the data in another control which is called the detail. When the user selects an item in the master, the corresponding data in the detail is displayed.
When designing a form template in InfoPath design mode, inserting a Master/Detail control into your form is easy. There are actually two ways to do so. The first way is to use the Master/Detail control in the Controls toolbox. Inserting the Master/Detail control from the Controls toolbox actually inserts two controls – a Repeating Table that is designated as the master and a Repeating Section that is designated as the detail. When you insert the Master/Detail control this way, as long as the “Automatically create data source” checkbox in the Control toolbox is checked, a simple data structure is created in the data source. This structure consists of a group node containing one repeating group node that, in turn, contains four child fields. The master and detail are both bound to the inner repeating group node. In this case, the master and detail are said to be linked by position in the tree. This basically means that if you select the third item in the master control, for example, the data for the third item is displayed in the detail control. This enables you, for example, to build a form that contains basic customer information, such as customer name and SSN, in the master and more detailed information about that customer such as address and phone number, in the detail.
The second way to create a Master/Detail relationship is by manually specifying which control is the master and which is the detail. Although this is a bit more difficult than choosing the Master/Detail control from the Controls toolbox it does give you more control over how the master is linked to the detail. (As mentioned earlier, one way of linking a master control to a detail control is by position. The second way to link a master to a detail is by key field. This type of linking allows you to specify a primary key/foreign key type of relationship where the value of the primary key in the master determines which detail data is displayed. This type of linking is only available when creating a Master/Detail relationship manually.)
To create a Master/Detail relationship manually, perform the following steps:
Now, when you use your form, you will notice that when you select an item in the master, only those detail items whose detail key matches the master key of the currently selected item in the master control will be displayed.
Obviously, if there is no data, no details will be displayed. InfoPath provides a nice way to deal with this situation. When walking through the steps to manually create as Master/Detail relationship above, you may have noticed the option “Copy key field from selected master when inserting detail” which is checked by default. This option designates that when inserting a new detail item, the value of the master key of the item that is currently selected in the master control will be automatically copied to the detail key in the new detail item. This is quite convenient when creating Master/Detail data from scratch.
As you can see, creating a Master/Detail relationship in InfoPath 2003 SP-1 is very easy and is just one of the many new features that were added in direct response to customer feedback.
I do not see the master/detail tab in the properties box. has this been changed for Infopath 2010?
RE: "I do not see the master/detail tab in the properties box. has this been changed for Infopath 2010?", this control is only available when designing filler forms. In the Designer, New, under available form templates, select Blank Form (InfoPath Filler)
Found that thanks.
Still having problems with the form though.
I would like to select a name from a dropdown list linked to a sharepoint list. I have go this figured out.
where I am blocked is that based on that name I would like to populate two other fields in the form from the same list and I just can't seem to figure out how to do that. any help would be appreciated
I am unable to see/locate the Master/Detail control in InfoPath 2010. Likewise, I don't see a Master/Detail tab when opening the properties window of a repeating table. What's the deal?
this control is only available when designing filler forms. In the Designer, New, under available form templates, select Blank Form (InfoPath Filler)
How can you avoid duplicate values in the Master/Detail? If you do the standard valuation rule for finding dups in a repeating table (ie have hidden field to hold a value and this would be the formula: count prceeding and following siblings etc) then you add a validation rule that if this hidden field is greater than '1' - then it throws up the red box. However with a Master/Detail, the data IS duplicated already so everything is red - how do I get around this?