Pop up dialog box for debug [message #656172] |
Mon, 26 September 2016 10:26 |
|
Janning
Messages: 43 Registered: April 2016
|
Member |
|
|
Hi,
If this is at all possible, is likely an easy answer. What I am looking for is a way to display to the screen (preferably a dialog box) the values in variables as a page is running.
Lets say for example I have an APEX page, which lists records of information. I also have a checkbox as the first column on the left.
I select several of the records and I click my Delete button. Over in Page Processing, I have a process, in After Submit, called
"Remove_records" Within this I have the below
For I in 1..APEX_APPLICATION.G_F8.COUNT
Delete from table_name a where record_id = APEX_APPLICATION.G_F8(I));
END LOOP;
What I am looking for is something like this:
For I in 1..APEX_APPLICATION.G_F8.COUNT
My_output_to_screen('Deleting record_id '||APEX_APPLICATION.G_F8(I) );
Delete from table_name a where record_id = APEX_APPLICATION.G_F8(I));
END LOOP;
Obviously the " My_output_to_screen('Deleting record_id '||APEX_APPLICATION.G_F8(I) );" is something I just typed in,
My question is what is the correct syntax, used in place of this, which would show it when I run the app? I'm envisioning it being a dialog box,
showing the below, with an OK button to continue to the next record_id:
Deleting record_id 12345
|
|
|
|
Re: Pop up dialog box for debug [message #656180 is a reply to message #656173] |
Tue, 27 September 2016 03:09 |
|
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
Try APEX_APPLICATION.G_PRINT_SUCCESS_MESSAGE. For example:
apex_application.g_print_success_message := l_cnt || ' rows deleted';
It is displayed on a top of the screen (just as built-in Apex messages), so I'm not sure you'll benefit from it much (as it certainly isn't a dialog box). Moreover, even if you put it into a loop, I *think* that it'll display just the last ID being deleted.
However: why would you want to do that, anyway? Imagine someone deletes 3 records and confirms 3 of them. Fine. Now imagine someone deletes 57 records and has to click 57 times "OK" - that's annoying.
Furthermore, what you described (a form with checkboxes etc.) looks like a tabular form, but it appears that you wrote the one on your own. Why? An Apex tabular form already has all those functionalities (row selector at the beginning of every line, DELETE button, deletes only selected rows ...) so - why wouldn't you use it?
Finally: obviously, I'm unable to answer your question. Sorry.
|
|
|
|