VANJ wrote:After so many years and questions, why haven't you posted full details of what these after-submit validations are supposed to do, the code involved, how they "choke"—error messages, debug trace etc—and sample data. Or of course the ubiquitous example on apex.oracle.com.
When a page item with source=DB column uses a Number type and a currency format mask (FML999G etc), when the page is rendered, it properly formats the number.
The built-in Item is numeric validation appears to be handle this reasonably ok. i.e. both formatted values and only-digits both validate ok.
But any after-submit validations choke on the non-numeric characters in the field! Please don't tell me I have to a) create shadow items and/or b) replace() out the non-numeric characters in the validation.
After so many years and versions, why doesn't APEX have a simple, declarative, elegant solution to handle such a basic function?
Why / how is it so easy for me to get it wrong? What don't I know about APEX -- that if I knew it -- would have allowed me to avoid this error?
a. When page first renders, the field gets displayed without the formatting i.e. 1234567.89 instead of $1,234,567.89. Is this because it is not a DB column field? Not very clear. Under some circumstances, I have seen it initially rendered with the currency formatting.
select null from dual where :P6_X < 10000
Item Help - "Select or enter a format mask. Note that format mask is applicable only to items of source type Database Column."This help text appears in the field Source > Format Mask. I am referring to the Settings > Format Mask field that shows up when Item Display As is set to Number
I've found the most data entry fields avoid formatting.I disagree. When rendering data-entry forms that contain large amounts (e..g millions), the formatting is essential to avoid mistakes.
Clearly, this presents a challenge because if the SAL field contains formatting (note that the built-in validation in #1 above does accept this as a valid number!), the DA will raise a Invalid Number error. So the DA code has to replace/translate/to_number out the non-numeric characters. Show stoper? Not at all. Annoying? Yes!
select 'Salary is '||:P6_SAL from dual