Understanding Dependent UDAs
Release 2018 R1 introduces the ability to add logic to User Defined Attributes (UDAs) that have Predefined Value lists, allowing you to define Dependency Contexts that determine what options are made available to your users under different circumstances.
This allows you to help narrow down the choices that your users need to make so that they do not waste time selecting values from a huge range of possibilities and help them to avoid making incorrect or nonsensical choices.
For example, say that your company needs to specify the temper applied to a given material. There might be hundreds of temper values available to choose from. By defining a Predefined List UDA to automatically narrow the available tempers based on the material that is selected, you can automate what would otherwise be a near-impossible task.
Another example could be the organizational hierarchy within a large global company that has multiple regions, with each region having multiple product lines, which in turn have multiple projects. Having a single list of all company projects could quickly become unnavigable for users looking for a particular one. But if you define lists to display only those projects that exist within a particular product line within a particular region, the choice is narrowed down to a manageable selection.
Dependent UDA Example
Here’s a simple example. Assume that your company has three regions, each of which has a specific product line, and each product line has three active projects:
 
Region:
North America
Europe
Asia
Product Line
Widgets
Gizmos
Doodads
Projects
X1A
X1B
X1C
X2A
X2B
X2C
X3A
X3B
X3C
You can define three UDAs for Region., Product Line, and Projects, and give them predefined lists for the values. But if you place these lists on the Cost Guide and expect your users to select the correct combination of values when costing components, there’s a very good chance they could get it wrong and spend a lot of time in the process. For example, a user could select “North America” for the region, and “Gizmos” for the product line, and “X3B” for the project – none of which match the other values.
Here’s how you could define these UDAs with Dependency Contexts to ensure only the correct values are made available, based on other selections.
1 Define a Predefined List UDA for Region. Note that this top-level UDA does not have any Dependency Contexts:
2 Define a Predefined List UDA for Product Line. Note that this UDA has Dependency Contexts on Region. North America is shown, but you would need to define dependencies for Europe (Gizmos) and Asia (Doodads) also.
3 Finally, define a Predefined List UDA for Projects, which has dependencies on Product Line. Widgets is shown, with the three projects that belong to that line, but you would need to also define the dependencies for Gizmos (X2A-X2C) and Doodads (X3A – X3C).
4 Make sure to make these UDAs visible with Dialog Views. (See Managing dialog views for more details.)
Publish your work, and then go to the Cost Guide and see the results:
Assuming that you have not done any other customization, the new attributes will appear at the bottom of section 1.2 Company-Defined Attributes.
Now when your users click through these attributes in order (top to bottom), each selection will determine what the next menu will offer. For example, selecting “North America” for the region ensures that only “Widgets” is available for Product Line, and only “X1A, X1B, X1C” are available for Projects:
 
Dependency Terminators
When we defined this simple example, we didn’t take any precautions against having our users access these new UDAs out of order. Look what happens if they jump directly to Projects before selecting a Region and a Product Line:
The Projects UDA drop-down menu will display a completely unfiltered menu (i.e., it displays all possible items). For this small example, this is not a huge problem: only nine items show up. In a real-life situation, the user might be overwhelmed with dozens or hundreds of options. And if they select one, and then select an item in the Region or Product Line that does not support that project, their original selection will be cleared and they will need to make another selection, this time from the valid options shown.
To avoid this kind of situation, we are going to add dependency context terminators to the Product Line and Projects definitions. This are special Dependency Context definitions that take effect if none of the expected conditions are met.
1 Go back to Steps 2 and 3 of the previous examples and add the following lines to the Product Line and Projects UDAs as shown in the screenshots below:
UDA: Region: Any
UDA: ProductLine: Any
(You specify “Any” by leaving the Values column blank when you define the Dependency Context.)
2 Re-publish, then bring up a fresh Cost Guide.
3 Now the Product Line field is disabled until you select a Region, and the Projects field is disabled until you select a Product Line. A “Why is this disabled” link explains to users how they need to proceed.