I’d use the User Codes instead of a UD table. You can make each status code a UDCodeType and then the available reasons would be CodeIDs under that type. Then your Reason combo can be setup as a usercodescombo (see link below for reference), and instead of hard coding your Code Type in the Filters Params you could try CodeTypeParam=‘{yourdataview.UD_OrderStatus_c}’.
I haven’t tested that so it might need tweaked a little.
Correct me if I’m wrong, but this might only work for the first time that the secondary combo is opened … Combos don’t handle dynamic filters very well, if at all.
If you can, load the data into a dataview and set the combo to read from it - and then you can manipulate that dataview however you need to.
Thanks for all the suggestions on using the UserCodes.UserCodesCombo approach. I was able to get the Reason combo to dynamically change its CodeType based on my UD_OrderStatus_c value and pull in all the CodeIDs under that type. However, it doesn’t support a second-level filter of those codes by another field’s value—so once the combo is loaded it still shows every reason for that CodeType, not only the ones valid for the current Status.
In other words, the built-in UserCodes combo will swap out the CodeType, but it won’t filter the loaded codes within that type by my UD_OrderStatus_c mapping.
At this point it looks like the only way to build a truly cascading dropdown in AppStudio is to:
Create a small UD mapping table (Status → Reason).
Load that table into a DataView.
On Status change (or on load) run:
dataview-clear + dataview-filter-set + combo-refill
Question: is there any other “supported” AppStudio pattern or built-in combo type that will let me filter UserCodes within a CodeType based on another field? Or am I right that for true cascading dropdowns we must use a UD table + DataView actions?