Limit and Dependent Codes Overview
Limit codes and dependent codes each allow you to define or "limit" the code values that are available in one field (the target category) based on the value that is selected in another field (the driver category).
The two features are very similar, with a few important differences.
Dependent Codes
Dependent codes are all or nothing. If you use them, you must set them up for every code in the driver category. Any driver code which does not define a dependent code in the target field will show no available options in the target.
For example, you may set up the following as the only dependency on a field: "A value of Code1 in Field A allows a choice between either Code2 or Code3 in Field B."
Limit codes will limit only the driver codes that you define. All other codes in the driver category will still show all possible code values in the target field.
In this case, if the user enters Code1 in Field A, they will see both Code2 and Code3 as available choices for Field B.
However, if the user enters any other value in Field A or does not enter any value at all, they will see no valid choices available for Field B.
Limit Codes
Limit codes are more of a guide during data entry. For example, you set up the following limit: "A value of Code1 in Field A limits Field B to either Code2 or Code3."
In this case, if the user enters Code1 in Field A, they will see both Code2 and Code3 as available choices for Field B.
So far, this is the same as a dependent code.
However, if the user enters any other value in Field A, they will see all the possible values for Field B. In other words, their choices for field B have not been limited.
Also, if the user does not enter any value in Field A, they will see all the possible values for Field B.
Other Differences
If the user enters a value in the target field, then goes back and changes the value in the driver field, the behavior differs slightly:
For Dependent Codes:
If the target is still valid based on the new driver, no change is made.
If the target is invalid based on the new driver, the value is cleared from the target field.
For Limit Codes:
The value in the target field will remain unchanged, regardless of whether it is valid based on the driver code.
Priority of Execution
If you have both limit codes and dependent codes defined for a given category, only one will be used, in the following order of precedence from high to low:
folder dependent codes
dependent codes
limit codes
Summary
The choice between the dependent codes and limit codes depends on whether you want to always control what one field shows based on another field's value (dependent codes), or if you only want to control what a field shows when certain values are entered into another field (limit codes).
The final difference between these two features is that Dependent Codes are set up as a migration rule, whereas Limit Codes are considered a type of suggestion.