Controlling and dependent structures allow attributes to be linked together within an item. One attribute controls one or more other attributes. The controlling/dependent structure is defined in attribute 4 (structure) of the attribute-defining item.
For a controlling attribute, the structure is:
c;attribute#{;attribute#}… |
where
attribute# |
Attribute number of the dependent attribute. This attribute may control more than one other attribute. Multiple attribute numbers are separated by semicolons. |
For a dependent attribute, the structure is:
d;attribute# |
where
attribute# |
Attribute number of the controlling attribute. There may be only one attribute number on which this is dependent. |
Rules for a controlling/dependent relationship are:
Controlling/dependent relationship always involves at least two attribute-defining items:
one controller
one dependent
One controlling attribute controls one or more dependent attributes.
There must be a dependent attribute.
When inputting data, both controlling and dependent attributes must be entered even if one of the values is null.
When displaying data, you must specify the controlling attribute to show a dependent attribute.
Controlling/dependent relationships can be very useful when using a more complicated item structure. For example, an invoice file can be created with the following attributes:
invoice.number
invoice.date
customer.account.number
part.number
quantity
price
freight.charges
taxes
The part number, quantity, and price attributes are prime candidates for a controlling/dependent structure. The part number is the controller and both the quantity and price attributes depend on the part number. In this case, part number must be part of the output list in order to output quantity or price.
When using AQL or Update Processor, not every dependent attribute must be listed. However, the controlling attribute must be output to see any or all dependent attributes. When MultiValues are entered, a part number value must have corresponding quantity and price values, even if these are null. This assures that the third value in the price attribute corresponds to the third value in the part number attribute.
The Update Processor recognizes the controlling/dependent structure and tries to list the attribute names across the screen, reminding you that these are controlling/dependent attributes.
To use a controlling or dependent structure some of the time and avoid it other times, create an additional attribute-defining item for these attributes and keep the controlling or dependent structure empty.
As the controlling or dependent structure links the nth value in the controlling attribute to the nth value in the dependent attributes, it would be unwise to permit these values to be independently edited, or the number of values can become unbalanced. If it does, the system may report it with error [68] from the messages file.
See Also