0 Replies Latest reply on Apr 7, 2015 9:04 AM by 1033209

    Rollback, Save point and Commit in Oracle forms

    1033209

      Hi,

       

      Wanted to achieve the functionality, when user opens a form save point should be saved and later he will do some changes (only updates) later he has to click my custom button. If user forgot to click and he tries to close then wanted to show an alert message do u want to save the changes, if yes commit , if no rollback all the changes whatever he made.

       

      I have written as below, but it is not working..

       

      In When-new-form-instance

      SAVEPOINT SAVEP1;

       

      In when-button-pressed

       

      DECLARE

      n_button_selection number;

      BEGIN

      FND_MESSAGE.SET_STRING (' Do you want to Confirm Hub Receipt?');

      n_button_selection := fnd_message.question (button1 => 'Yes',

                               button2 => 'No',

                               button3 => NULL,

                               default_btn => 1,

                               cancel_btn => 2,

                               icon => 'question');

        if n_button_selection = 2 then

        -- ROLLBACK TO SAVEPOINT SAVEP1;

        -- Clear_form(no_validate);

        -- Exit_Form(NO_VALIDATE);

        -- APP_CUSTOM.CLOSE_WINDOW(:SYSTEM.EVENT_WINDOW);

        rollback;

        else

           COMMIT_FORM;

        end if;

       

      end;

       

      But it is still asking Do u want to save ?

      Please suggest