With our server framework, the right approach here is actually entirely declarative: addUnknownValues:true, validateOnExit:true, hasRelatedRecord validator on the field.
"workarounds and ugly tricks" is a wildly inappropriate characterization of this approach. It really couldn't be simpler. If you just implement the equivalent of a "hasRelatedRecord" validator in your server and use an appropriate error message (eg "Please choose a valid relatedDS.title"), you'll be all set, and you will also have covered other possible sources of bad inserts instead of *only* solving the problem for one ComboBoxItem.
This is the cleanest solution, and we don't want add a redundant, worse mechanism to the framework.
"workarounds and ugly tricks" is a wildly inappropriate characterization of this approach. It really couldn't be simpler. If you just implement the equivalent of a "hasRelatedRecord" validator in your server and use an appropriate error message (eg "Please choose a valid relatedDS.title"), you'll be all set, and you will also have covered other possible sources of bad inserts instead of *only* solving the problem for one ComboBoxItem.
This is the cleanest solution, and we don't want add a redundant, worse mechanism to the framework.
Comment