2
votes

In Oracle APEX, is it possible to create a validation so that field B cannot be null if a "Modem" is selected in field A? (field A is a Select List that contains a List of Values that uses a query to receive it's list of values)

Thanks Tony, Your solution makes sense but it didn't work in my case.

Here is my validation:

enter image description here

enter image description hereenter image description here

The result is not what I expected. I would like an error only to show up for "Unit Ip Address" when Modem is the selected Device Type when the field is null. enter image description here

Additional Info that describes the "Device Type": enter image description hereenter image description hereenter image description here

1
I added this to my answer: Note that the condition on the validation is based on the return value of the LOV, not the display value. In my case they happen to be the same, but in yours they are not and your condition should be based on the ID of the device type rather than the description.Tony Andrews
In other words "Expression 2" should be something like "123" rather than "Modem"Tony Andrews

1 Answers

3
votes

Yes - see this example, where field Commission cannot be null if "Salesman" is selected in field Job.

It is simply a "Not Null" validation on item P15_COMMISSION, with a condition to perform the validation only when P15_JOB has the value "Salesman"

This is the validation definition I used: enter image description hereenter image description here

Note that the condition on the validation is based on the return value of the LOV, not the display value. In my case they happen to be the same, but in yours they are not and your condition should be based on the ID of the device type rather than the description.