I'm creating a calendar in APEX 5 with associated forms to maintain the calendar items. I'm doing this through the wizard on a table with a primary key (and associated sequence), date column and a caption column. The calendar screen works fine, when I click on an empty date a modal form appears to allow me to add a calendar item. When I click apply changes to the item I get the error ORA-01403: no data found
.
I assumed that this is because the pk is not being populated so I added a process on submit after validations to populate the pk column as we have in other default CRUD forms. It has a low sequence number so should execute first when the apply changes button is pressed. The code is:
begin
if :P5_SIGHTING_ID is null then
select "#OWNER#"."SIGHTING_SEQ".nextval
into :P5_SIGHTING_ID
from sys.dual;
end if; end;
However when I run the form I still get the same no data found error when trying to create the record.
Update - if I change the pk item from hidden to text field I can see that it is populated correctly so the trigger above doesn't seem to be required. I think this error is raised during redirect back to the main calendar but I'm not sure how to debug this.