In APEX 4.1 I'm trying to do something similar to this thread: Tabular form: compare two column fields where I need to do a validation on two columns in a tabular form. This works for two columns that are text box columns but I can't get it to work when comparing to a display only column. For the validation, I have it set as a "PL/SQL Expression" and my expression is: :CURRENT_VALUE > :PREV_VALUE where CURRENT_VALUE is a text box column that accepts user input and PREV_VALUE is a display only column.
Regardless of the input, the row is updated without any errors raised; it seems to treat the display only value as empty and does the comparison with an empty value. The only workaround that I was able to come up with was to do the comparison in an on update trigger and raise an error if the validation fails; but the result isn't as nice as the built in validation features of APEX.
Any insight into how to get this to work using APEX validation is greatly appreciated.
Display only columns are only for display and are not saved in the session when you submit, so you can't access them with pl/sql.
I had previously tried setting the column to a text box but I didn't see an option to make it read only. But after reading your response it got me thinking that maybe I was missing something and then I remembered that I have the ability to set the element attribute and so I tried setting it to read only and sure enough it worked. So thank you for your response.