3 Replies Latest reply: Apr 2, 2013 10:51 AM by user1007 RSS

    Different 'Process success' messages for insert, update,delete?

    user1007
      I am using standard 'Process Row of...' process, created throughout the wizards for editable IR.
      Is there any way to make it generate different process success messages depending on what type of DML has been implemented?
      Like, instead of having 'Action Processed.', is it possible to have something like 'Record has been updated', 'Record deleted', 'New record created'?
      I know this can be done when custom process contains PL/SQL code using apex_application.g_print_success_message(), but in my case I am using standard APEX processing with no explicit PL/SQL code involved. Another option might be a table trigger containing apex_application.g_print_success_message calls...but it is sort of inconvenient to generate triggers for such a minor purpose.
      Is there anything that can be implemented in APEX only, without modifying server-side objects?
        • 1. Re: Different 'Process success' messages for insert, update,delete?
          Jeff E
          Create a copy of the "Process Row of..." process for each type of DML message you want to create.
          Edit each process and set the "Allowed Operations", "Process Success Message", and "When button pressed" fields...

          Process 1:
          Name: Process Row of TABLE (Create)
          Allowed Operations: Insert
          Process Success Message: New record created
          When Button Pressed: CREATE (Create)

          Process 2:
          Name: Process Row of TABLE (Update)
          Allowed Operations: Update
          Process Success Message: Reacord has been updated
          When Button Pressed: SAVE (Apply Changes)

          Process 3:
          Name: Process Row of TABLE (Delete)
          Allowed Operations: Delete
          Process Success Message: Record deleted
          When Button Pressed: DELETE (Delete)
          • 2. Re: Different 'Process success' messages for insert, update,delete?
            JackieW
            Here is another approach. Create a hidden item e.g. P100_SUCCESS_MSG. It should be unprotected. In a post submit computation or process, set the text of the item based on the REQUEST. For example an after submit computation based on a query:
            select decode(:REQUEST,
                            'CREATE', 'New record created',
                            'SAVE', 'Record has been updated',
                            'DELETE', 'Record deleted')
                          ) success_msg from dual
            Next, in the DML process, make the DML success message something like this:
            Action processed: &P100_SUCCESS_MSG.
            You can also add html tags to make the message fancy, or maybe include the primary key value or some other item from your page.

            Edited by: JackieW on Apr 1, 2013 11:54 AM (spelling)
            • 3. Re: Different 'Process success' messages for insert, update,delete?
              user1007
              Thanks, JackieW, that's exactly what I need!
              I created application level hidden item and 'after submit' computation also on application level, works like a charm!

              Edited by: user1007 on Apr 2, 2013 8:49 AM