A conditionally required field is a field that should be visible and required, but ONLY if another field has a specific value. The syntax used to set up the Field Class properly is as follows:
planetj.database.field.ConditionallyRequiredField,<Field to Check value>,<Value to match> (replace the < > with their values).
As an example, lets say we are creating a used car inventory application. Generally, modern cars have a few different engine types now including GAS and ELECTRIC engines (others exist as well, but for this example and for simplicity we will just use these 2 specific types). The only issue is with a GAS powered car, the customer will care about the MPG rating of the car, while for the ELECTRIC engine, the customer is more likely concerned about the Distance the car will run on a full charge (Range).
In this example we will want the MPG field to be visible and required if the TYPE field equals GAS and the RANGE field to be visible and required if the TYPE field equals ELE (ELECTRIC). Previously custom Java work would be required to enable this type of feature, but now with a field class it can be enabled.
In the example above, we would need to add the field class of planetj.database.field.ConditionallyRequiredField,TYPE,ELE on the RANGE Field Descriptor and planetj.database.field.ConditionallyRequiredField,TYPE,GAS on the MPG Field Descriptor. This would ensure that when a row had a TYPE value of GAS the MPG field would show up and be required to have a value. Conversely, if the row had a TYPE value of ELE the RANGE field would show up and be required.
A demo operation using ConditionallyRequiredField in this exact manner can be found HERE.
Note: This Field Class only functions in Details mode (insert, edit, view record) and will not function in the RowCollection or on the Results table.