This content has been marked as final. Show 3 replies
Setting the apex_application.g_print_success_message variable will not work as it is used only during page rendering.
What you could do is
a. Create a hidden item on the page, say P1_FOR_DA_HDDN
b. In your DA make the following change
c. In the DA's "Page Items to Return" enter P1_FOR_DA_HDDN
--apex_application.g_print_success_message := 'Alarm processed successfully.'; apex_util.set_session_state('P1_FOR_DA_HDDN', TO_CHAR(SYSTIMESTAMP) ); -- SYSTIMESTAMP is only to force a change in the item every time the process is run. Alternate to using null/not null or other values.
d. Create a DA on P1_FOR_DA_HDDN, event On Change, that has True Action "Alert" and give the message "Alarm processed successfully." in it.
Here is what will happen
1. When the process is run the hidden item value will change
2. Change in value of hidden item will trigger the "On Change" DA on it.
It will show an Alert box, not in the SuccessMessage area. But as your purpose is to inform the user , I believe this will suffice.
1 person found this helpful
nscglr wrote:This PL/SQl global variable will only be useful when the page is rendering and it will not change the message once the page is rendered.
I have a dynamic action that executes a pl/sql code block. I need to display a message when this procedure is completed. I tried several options like using "apex_application.g_print_success_message" but I couldn't achieve this. Here is my plsql code :
CREATE OR REPLACE PROCEDURE processAlrm
p_alarmAction IN VARCHAR2
,p_alarmID IN VARCHAR2
apex_application.g_print_success_message := '<span style="color:red">Alarm processed successfully.</span>';
EXCEPTIONWhat happens if there is any error?
END processAlarm;In your Execute PL/SQL Code set the checkbox stop execution on error
Do you have any idea how can I do this?
Create an another true action in the same dynamic action as > notification > alert > enter your success message.
So once the plsql action is successfully executed, it reaches this point and shows the success message.
If the plsql fails with error then dynamic action stops there and no alert is shown.
You may also download and install Notification plugin to make the alert look better
Oh, I couldn't set two correct answers. Thank you very much for your help.
And I like this notification plugin.! Thanks.
Edited by: nscglr on May 31, 2012 11:53 PM