I think most of us had already the problem, that when the Display Null property for a LOV has been set to “Yes”, that APEX had generating a %null% as indexing value for this “null” lov entry.
The problem now is that when the user selects the “null” entry from the select list, the page item gets populated with the %null%. If you don’t write some code to set the item to NULL when it has %null% as value, the database will raise an error (eg invalid number…).
Recently I posted a generic solution for that on the OTN forum.
I now have integrated the code into my ApexLib_Lov package which I have developed for my Generic solution for cascading select lists/lovs.
Integration into your Application
- Create a Application Process (Shared Components\Application Process)
- Name: ApexLib_Lov_clearLovNullValues
- Sequence: 1 (should be a number before any of your page level processes)
- On submit: After Page Submission – Before Computations and Validations
- Process Text:
- Process Error Message: #SQLERRM#
In the case if you don’t want to reset the %null% for a lov, you can specify $APEXLIB_IGNORE_LOV_NULL$ in the page item comment to skip the reset.
That’s it! That solution will now work for all your pages.