Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Javascript Confirm box dependent on results of query

Owensatron1234Apr 10 2013 — edited Apr 16 2013
Hi

I'm using Apex version 3.2.1 and I'm looking for a way to do the following, any help much appreciated:

A javascript confirm box will appear when the user submits a page if the result of a query returns anything, the query would look something like this....

SELECT * FROM LINKEDPROJECTS
WHERE ENV_ID = :P18_ENV_ID
AND COMP_ID = :P18_COMP_ID
AND DATE_FROM <= to_date(:P18_DATE_TO, 'DD-MON-YY')
AND DATE_TO >= to_date(:P18_DATE_FROM, 'DD-MON-YY')

If it doesnt return any data the page will submit as normal, if it does return any data the confirm box will appear, and the message will also be driven by the result of a query.

So the message would be something like....

Project(s) +"Select NAME FROM PROJECTS WHERE ID IN (SELECT PROJ_ID FROM LINKEDPROJECTS WHERE ENV_ID = :P18_ENV_ID+
+AND COMP_ID = :P18_COMP_ID+
+AND DATE_FROM <= to_date(:P18_DATE_TO, 'DD-MON-YY')+
+AND DATE_TO >= to_date(:P18_DATE_FROM, 'DD-MON-YY')"+ have this environment booked on the dates you selected. Do you want to continue with the booking?

Selecting yes submits the page, selecting no returns them to the page.
This post has been answered by Owensatron1234 on Apr 16 2013
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 14 2013
Added on Apr 10 2013
8 comments
490 views