Refreshing Page after PL/SQL Process Completes

Reader's Digest Condensed Version: I have been unsuccessful searching the forum for a method to Refresh the current page AFTER the execution of a PL/SQL Process defined on the same page.
War & Peace Version: I have a page which displays multiple records for editing on P1001. I also utilize a checkbox in combination with a button to perform some intermittent steps. Essentially, the user selects a row to "clone" by checking the appropriate checkbox and clicking the "clone" button. The first thing the button executes is a JavaScript function on page P1001, which calls a popup window (P1010) so the user can select a new value for the primary key. This is required to maintain data integrity of course and avoid duplicate records. Page P1010, contains two text fields with Popup links for each. The user can either enter their values directly, or use the link which will calls another JavaScript function to call a popup page P2 to display the results of an SQL query. Once the user makes their selections, another JavaScript function on P1010 passes back the selected values and stores them in hidden variables on P1001. At this point, I want my PL/SQL process, CLONE_RECORD, to execute examining the values from the record to-be-cloned and the new primary key values. The PL/SQL checks the database to see if the record already exists. If it does not, then validation of the data occcurs and a SQL insert string (myInsertSQL) is generated. I then "execute immediate myInsertSQL;" and "commit;" from within my PL/SQL. The procedure terminates, and at this point I want the original page P1001 to refresh. If the insert was successful, the new cloned record should be displayed along with the other previously displayed records.
I am having issues with the timing because I am able to insert the cloned record into the database, but I have to manually refresh my page to see the resulting new record. I know that PL/SQL is executed on the server and that JavaScript is executed at the browser, but how can I synchronize my process, or at least perform an HTML POST(?) to refresh the page at the end of my PL/SQL procedure?
As always, any assistance is greatly appreciated.
MovingTarget
PS. I am using HTMLDB 2.0 so please be kind.

MovingTarget,
Before I get into this I want to make sure you understand that in general, unless it's a really long process, you want the submitting page to have an On Submit process that calls your PL/SQL process. Then you can provide a branch back to the same page if you like or to any other page for that matter. Also, the PL/SQL error handling in ApEx is not too great right now but there are plans to improve it in the next version. In the mean time you have to use some tricks if you want to display "pretty" messages on exceptions.
I'll tell you how I would approach this and let you tell me why it would not work or what I'm not getting...
You have a main page, that in order to submit, needs a pk value populated from a popup (pu1), which in turn calls another popup (pu2). I'll create an imaginary situation in which I might have the same pages... I'm populating a users table (legacy) with a pk that is a combination of the employee's dept and name. The pu1 shows departments and pu2 shows emps in those departments.
So, I click "add new user", then click on a button that opens pu1. I see the departments and then click on another button that opens pu2 to see the names. I click on a name and user JavaScript to close the popups and populate and item on the parent page with a string that is made from the employees department and name. NOW I click "save". The page submits and calls a PL/SQL process that passes in the values from the parent page to the INSERT process. After the process is run a branch redirects the user back to the same page and displays the success message from the PL/SQL process.
I hope that didn't just make things worse! lol
Dan

Similar Messages

  • Can not refresh page after save properly(When not saving master record)

    I am using jdeveloper 11g R2 (11.1.2.3) JSF Facelet
    In some use case I have Address as master table and Person as detail table
    For some business reason I need to don't save same addresses
    eg:
    If +1 Test St+ is in database already and new user coming and adding this address with new person
    I need to use the row in database not creating a new address
    I do saving in doDML method of Address with some hashing algorithm and it is fine
    My problem is that I can not refresh page after save properly
    User coming to page think Adding a new address and a new person but in fact no new
    address added because of business I describe above
    Any ideas how I can implement this?
    Appreciate that
    Regards
    Mohsen

    Hi,
    from your description it is not clear why the page doesn't refresh. It could be a problem in your implementation code - who knows. What if you perform the address check on a command button that actually submits the new address? If the check returns true (address exists) you would call row.refresh(forget new row); and re-query the view object so the address coming from the database is displayed. If you wanted to use the doDML then yuou need to be aware that doDML doesn't help removing the row the user created. It just ignores the database update but the entity is still around, which in my suggested solution wont be the case.
    Frank

  • Best way to refresh page after returning from task flow?

    Hello -
    (Using jdev 11g release 1)
    What is the best way to refresh data in a page after navigating to and returning from a task flow with an isolated data control scope where that data is changed and commited to the database?
    I have 2 bounded task flows: list-records-tf and edit-record-tf
    Both use page fragments
    list-records-tf has a list.jsff fragment and a task flow call to edit-record-tf
    The list.jsff page has a table of records that a user can click on and a button which, when pressed, will pass control to the edit-record-tf call. (There are also set property listeners on the button to set values in the request that are used as parameters to edit-record-tf.)
    The edit-record-tf always begins a new transaction and does not share data controls with the calling task flow. It consists of an application module call to set up the model according to the parameters passed in (edit record X or create new record Y or...etc.), a page fragment with a form to allow users to edit the record, and 2 different task flow returns for saving/cancelling the transaction.
    Back to the question - when I change a record in the edit page, the changes do not show up on the list page until I requery the data set. What is the best way to get the list page to refresh itself automatically upon return from the edit-record-tf?
    (If I ran the edit task flow in a popup dialog I could just use the return listener on the command component that launched the popup. But I don't want to run this in a dialog.)
    Thank you for reading my question.

    What if you have the bean which has refresh method as TF param? Call that method after you save the data. or use contextual event.

  • Page having PL/SQL process and Automatic Row Process for 2 different tables

    Hi,
    I have a page containing 2 regions A & B.
    Region-A content would be updated to table T1(PK : Ticket#).
    Region-B content would be inserted into table T2(PK: Attachment# ; FK: Ticket#).
    Region-B is used for uploading a file content into T2.
    Since I cannot use 2 DML processes on the page for 2 different tables with a common column, so I have a PL/SQL process to update the record into T1 and an Automatic Row Process(DML) for inserting into T2.
    Now the issue is in Region-B when I select a file using 'Browse' button and click on Upload button to fire the Automatic Row Process, the success message is displayed but the file is not uploaded into the table. But when I moved the entire Region-B and the Automatic Row Process to a different page and clicking Upload is working fine and inserting the record into the table along with the file content.
    An item P10_TICKET_NUMBER with source type as Database column with source value as TICKET_NUMBER is used in Region-A.
    I have gone through the forums and found some of the threads below
    Re: 2 Automated Row Processes for one page?
    Re: Error when trying to create 2 Forms on same page on 2 tables with ID as
    where people facing similar issues but here I have followed the solution provided(with one PL/SQL process and other Automatic process) in the threads but still issue persists.
    Can anyone throw some light on this please.
    Thanks,
    Raj.

    Hi Teku,
    You just have a look at this thread, where u can find a solution for your problem.
    INSERTING Records into Second table based on First table Primary Key
    hope this helps.
    Bye,
    Srikavi

  • How to refresh page after selecting value from LOV item , in a tabular form

    Hi ,
    I have a tabular form, which contains 2 items(columns), of type "Select List - named LoV".
    Now, couple of issues here.
    1.
    2nd item(column) in tabular form, that LoV should get populated based user's selection value in first item LoV. So how do i refer to the value, that user selected in first item's LoV? I will have to use this reference in LoV query of my 2nd item ( on this tabular form)
    2.
    How can we refresh the page, when user selectes value in first item ( from LoV). As this is a tabular form, here item type is Select List, we dont have an option to pick item type as Select List with Submit. So problem is that when user selects value for item 1, refresh does not happen and item 2 LoV does not get populated as per user's selection in item 1.
    Please help here. Would be really appreciated.
    Thanks and Regards,
    Rave.

    Thanks Ben and Dan for your responses.
    Ben, your solution helped me with refresh of page, as page got submitted.
    This answers to my 2nd question. However, I still need to know first question, which basically is, how do i refer to the value, that user selected in first item LoV.
    Issue is, I selected the value in first item LoV, it got submitted and page fot refreshed. But after page refresh, first item LoV loses its value that I had selected last time. It does not retain the selected value after refresh.
    I have an unconditional process, that on every submit(refresh) of page, I set my items with their corresponding values. But problem is what do i mention there to refer to this item.
    I looked in view source of my page, this item is referred as f03.
    So i used "apex_application.g_f03", to set this item to its value, in my uncoditional submit process. But it did not work. I tried to refer this item as "f03" in this unconditional submit process. But still it did not help, the selected item loses its value after page refresh(submit).
    Any help here would be really appreciated. Please suggest how do we refer to this item's selected value.
    Thanks and Regards,
    Ravi.

  • Refresh page after execute event

    Hi all, I have a question, please help.
    I have a button on the view SOHOverView(BT115H_SLSO) to change the status.
    *** part of code of event ***
    CALL FUNCTION 'CRM_STATUS_CHANGE_EXTERN'
         EXPORTING
           objnr               = objnr
           user_status         = estat
         EXCEPTIONS
           object_not_found    = 1
           status_inconsistent = 2
           status_not_allowed  = 3
           OTHERS              = 4.
       "WAIT UP TO 1 SECONDS.
       IF sy-subrc <> 0.
         CASE sy-subrc.
           WHEN 1. message = 'object_not_found'.
           WHEN 2. message = 'status_inconsistent'.
           WHEN 3. message = 'status_not_allowed'.
         ENDCASE.
       ELSE.
         CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
           EXPORTING
             wait = abap_true.
       ENDIF.
    this code is executed and changes the state correctly, but to see the change you have to re-open the document. I need to refresh the page and the user can see the new status immediately.

    Hi Rudy,
    you can acheive this by reverting the bol buffer.
    Afte the FM call 'BAPI_TRANSACTION_COMMIT', check sy-subrc. If it is ZERO, execute the below code else not.
    * Read header Entity
      lr_ent ?= me->typed_context->your context node name->collection_wrapper->get_current( ).
    * get Transaction
      lr_trans ?= lr_ent->get_transaction( ).
    * Revert all changes
      lr_trans->revert( ).
    As you have already commited changes using 'BAPI_TRANSACTION_COMMIT'. Now revert will only bring the changes from the database again and will not affect your status changes which you made recently.
    Please let me know, if you have any issues.
    Regards,
    Jotsaroop Singh

  • BP  appearing in search results after BP merging process completed

    Hi Gurus,
    Can some one please throw some light on how to stop the displaying of BP's appearing in search results who have been assigned an archiving indicator (XDELE flag set) in BUT000 table.
    The scenario is as follows,
    We identify duplicate BP's, for eg- BP1 BP2 and BP3 are identical.
    Then BP2 will be confirmed as main BP and correct one.
    BP1 and BP3 will be merged to BP2 using the Merge accounts functionality in CRM 7.0 WEB client.
    BP1 and BP3 will have archiving indicator (XDELE field set to X in BUT000 table) after merging process.
    And the problem starts when agents are searching for BP2, still BP1 and BP3 who have XDELE flag set still appears in search results.
    The expectation is we do not want BP's to be appearing in search results that have archiving flag set in BP master record.
    Can some one please advise how to achieve this, is there any config step or we have to go for enhancement.
    Please advise.
    Thanks in advance,
    regards,
    Gopio.

    Hello,
    You have to use Archiving object - "FI_ACCRECV" to archive Customer Master Data (BP).
    When general data for customer master records is archived, the system automatically checks whether the following conditions have been met:
    - The deletion flag is set.
    - The customer is not locked for deletion.
    - Dependent data of the following types no longer exists in the system:
    1. Business partner of the customer
    2. Company code-specific data (FI data)
    3. Sales data (SD data)
    4. Transaction figures
    5. Special general ledger transaction figures
    6. Open items
    7. Cleared items in the archive
    8. Customer/Vendor links
    For the archiving object all the required configurations should be maintained.
    If you don't have archive server in place then do not take the option of storing (Just archive and delete the data).
    -Thanks,
    Ajay

  • Problem in refreshing page after role assignment

    My requirement is that as soon as the user logs in, a role should be assigned to him dynamically followed by refreshing of the browser window post which the role should be visible on Top Level Navigation.
    I've implemented it using JSPDynpage.
    I am able to assign the role. The refreshing of the browser is done through JSP using top.location.reload();
    The problem that I'm facing is that as the user logs in, the browser just goes on refreshing infinitely.
    Any pointers on that?

    Hi,
    To avoid refresh calls in a loop, you should set some flag in session params to break the loop.
    So as you load the JSPDynpage, check the flag in session and set a if condition to run reload or not.
    Regards,
    Praveen Gudapati

  • How to ensure that refreshed page is displayed after an update?

    I have a page with “Form” region. I’ve used “Table” for “Create a data entry form based on”. The form works as it should, but I have set the same page to go to after “Save” or “Apply Changes” button is pressed. Now whenever I change any field at the page via my form I get back to the same page, but the changes are NOT visible. I need to go to a different page and then back to my page with table form to see new/updated data.
    Is there a way of enforcing the refresh/re-query of the data after I click on Apply Changes/Save button?
    jarola has suggested the following topic: Branch to URL identify session and record ID
    However, when I follow the suggestion and add "Optional URL Redirect" to the same page (76) for "Apply Changes" button, and configure "Set These Items" with "With These Values" then the values entered via the form are NOT saved at all. If I remove "Optional URL Redirect" (I set "Target is a" to "- No Target -") then the data is at least saved when I click on "Apply Changes".
    Thank you for your time.
    Daniel

    I am gathering that what you want is for the user to make some changes, save the data, and be left with a refreshed page showing the new values, right?
    I order to save the data, the form usually has to perform some kind of submit action. Therefore, do not use a URL redirect. The only time you can use that is if your URL redirect calls javascript which in turn does a submit. But if you just redirect, no submit is done.
    Make sure whatever the user does to initiate processing is doing a submit. This usually is by clicking a button whose action is "no target" (this equates to some sort of submit action).
    Then, make sure this submit action invokes whatever process it is that does the save to the database. Check the row processng that was created during the wizard creation of the form and make sure that any conditions on it are such that it fires based on your request value or the button in question being pressed.
    (Actually this brings up a question...if after the save action, can you see updated data in the database via SQL*Plus or SQL*Developer (or whatever database query tool) but just not in Apex? This will at least tell you if the data is being saved and it's just an application presentation issue or not.)
    Then, make sure any proper page branches are firing. Again, look at the conditions and/or button-pressed settings. I think for this sort of thing I would clear the cache for your page via the page branch settings, and then do a "set these items..." and "with these values..." such that you are setting the PK values of the record with the existing PK values of the record you are dealing with. (I guess this assumes this form does the usual automated row fetch during loading if the PK values are not null. Is this the case?)

  • Before header pl/sql process creates blank space at top of page

    Hi,
    I'm finding that w/v 1.6.1 I get a blank space at the top of my page that appears to be somewhat proportional to the amount of code and/or # processes on that page that are before header. moving to after header and before regions also shows this behavior.
    There are no blank line outputs happening in the pl/sql processes, so I've got no idea why htmldb is putting blank space there.
    Anyone seen anything like this? Oracle 9.2.0.7, winxp pro
    Thanks
    matt

    Hi,
    I've had the same problem. I'm assuming that you have a region in the "After Header" position?
    If so, you could add the following in the region's Region Header:
    &lt;div style="display:none"&gt;
    and put this in the Region Footer:
    &lt;/div&gt;
    The region is defined in a table, which by definition is a block object. Block objects always begin on a new line and end with a new line - the above will put the region into a div and then hide the div.
    Regards
    Andy

  • Refresh First page after returning from a framed pop-up window

    HI Can anyone help me on this technical problem.
    I have got one mainpage and from there i'm calling a popup with two frames (left, right). At frame right i'm populating the tableview.
    So when i submit(button) in tableview(right), the table contents has to be replicated in the first page and the popup has to be closed. So far it has be done successfully.
    The problem is when i return to the first page the page is not getting <b> refreshed automatically</b>. FYI, i'm not using mvc for performance reasons.
    So i need your help on how to refresh the first page, after control passes from popup.
    Here is the code, that calls the popup window
    winvar=window.open("organization.htm", 'main','height=450,width=650,status=yes,scrollbars=yes,toolbar=no,resizable=yes');

    Hi Craig & Raja,
    Let me tell thanks for your response. But your valuable solutions are not working for me. Please, check this code and please let me know that any thing went wrong.
    Here is the code
    My main page is progress.htm
    ============================
    <script language = "javascript">
        function openOrgTree(){      
           var winvar;
           winvar=window.open("organization.htm", '<b>Main</b>','height=450,width=650,status=yes,scrollbars=yes,toolbar=no,resizable=yes');
      </script>
    <htmlb:inputField id          = "InputOrgPlan"
                            showHelp    = "X"
                            onValueHelp = "javascript:openOrgTree()" />
          <% if application->i_desc is not initial.%>
          <htmlb:tableView id              = "tvX"
                           headerVisible   = "false"
                           design          = "alternating"
                           visibleRowCount = "3"
                           fillUpEmptyRows = "true"
                           columnWrapping  = "false"
                           onHeaderClick   = "MyEventHeaderClick"
                           onRowSelection  = "MyEventRowSelection"
                           keyColumn       = "Text"
                           table           = "<%= application->i_desc %>"
                           iterator        = "<%= iterate %>" />
          <% endif. %>
          </td></tr>
    organization.htm (is the frames container)
    =========================================
      <!-- frames -->
    <frameset  rows="110%,*">
        <frameset  cols="40%,*" >
            <frame name="left" src="tree.htm" marginwidth="0" marginheight="0" scrolling="No" frameborder="0">
            <frame name="right" src="table.htm" marginwidth="0" marginheight="0" scrolling="auto" frameborder="0">
    table.htm (right frame)
    ==========================
       function callSubmit()
         alert(parent.window.name);  
    // displays the name as "<b>Main</b>" which i gave at the time opening oraganization.htm
    //        parent.window.opener.refresh();
    // window.opener.location.href = window.opener.location.href ;
             window.opener.refresh();
             parent.close(); // to close the popup
    // all of the above are not working
       </script>
      <htmlb:page onLoad = "callSubmit()">
    <htmlb:button id            = "submitbutton"
                        onClick       = "myButtonClick"
                        onClientClick = "callSubmit()"
                        width         = "10"
                        text          = "Submit" />
    i need onClick to populate the internal table and onClientClick to refresh the opener.
    if event->id = 'submitbutton'.
          refresh application->i_desc.
          application->i_desc = i_desc.
    Regards
    Swaroop

  • HT5655 After clicking Safari prompt box to "Download Flash..." , I'm linked to the Adobe Flash Player Download page. I click the "Download Now". The page advance to next page in the download process but then immediately goes black and nothing happens.

    After clicking Safari prompt box to "Download Flash..." , I'm linked to the Adobe Flash Player Download page. I click the "Download Now". The page advance to next page in the download process but then immediately goes black and nothing happens. System preferences firewall is off and apps are allowed from anywhere and in Safari other plug ins are allowed and cookies are not blocked and pop up windows are not blocked. Why won't Flash Player download?

    Don't DL Flash from web sites. If you have Adobe Flash installed it should be in System Preferences and you can find the latest version and download from there.
    If you are installing for the first time,this is where to DL it.
    http://get.adobe.com/flashplayer/

  • HT1365 How can I get my iPhone 4 to update my updates from my app store of it keeps telling me error 3150 or it tell me to refresh the page after updates and the updates are still there asking me to update them again

    How can I get my iPhone 4 to update my updates from my app store of it keeps telling me error 3150 or it tell me to refresh the page after updates and the updates are still there asking me to update them again?

    Make sure iTunes on the computer is logged into the account on the phone.
    Plug the iPhone in.
    In the popup window warning about wiping your phone, hit cancel.
    In the left pane of iTunes, the phone icon should be there.
    Right click on it, select transfer purchases.
    Note: this will only transfer music bought from iTunes. Not mp3's from amazon or ripped from CD's.

  • How do you bypass the Welcome\Registration page after a Netinstall complete

    Hi all,
    I am currently trying to use Snow Leopard server 10.62 to deploy Snowleopard to a number of MacBooks.
    I have a list of apps to go in to the build but for now i need to get past the first stage.
    first stage being, It is possible to bypass the Welcome \ Registration pages after a Netinstall deployment.
    i wish to use a clean image with a computer name given from the SIU and bind in to AD
    all this seems to fail but i can get an automated build but then i have to go through all the pages of registration...how do i get around this?
    I have also played about with NetRestore images but in the Define NetRestore Source in the SIU i have not idea what that ASR:// URL should be so it instantly fails

    I have had success with the following SIU 2 workflow:
    - Define Image Source (select a master hard drive to be cloned)
    - Create Image (Netrestore type)
    Note that I am using "Define Image Source" NOT "Define NetRestore Source".
    Neither "Apply System Configuration Settings" nor "Enable Automated Installation" are currently functional in Snow Leopard. Do not go there.
    Good luck.

  • ?? proceed to next page after video completes ???

    Basically i am suck working with iweb and i would like to have an introductory video play when my site is opened and automatically move on to the welcome page after the video is done running. If someone could tell me how to code this, i would greatly appreciate it.
    Thanx!

    See if the QuickTime Tutorials will help:
    +An HREF track is a special type of text track that adds interactivity to a QuickTime movie. HREF tracks contain URLs that can specify movies that replace the current movie, load another frame, or that load QuickTime Player.+
    http://www.apple.com/quicktime/tutorials/hreftracks.html
    You probably will have to create a custom HTML page of your own.

Maybe you are looking for