---
title: "Comment by Joe Kerr on \"APEX Background Page Processing - The Definitive Guide\" | Hashnode"
description: "Very well done, and helpful. I have an IG using FOS plugin to add Menu Items to \"Actions Menu\" that trigger a custom event that causes a Dynamic Action to fire"
url: "https://hashnode.com/posts/apex-background-page-processing-the-definitive-gude/66ec1d8a297094b056ab70b4/comment/66ef5f60e3f72d0f3cbd3af4"
---

[Discussion](https://hashnode.com/posts/apex-background-page-processing-the-definitive-gude/66ec1d8a297094b056ab70b4)

Comment [APEX Background Page Processing - The Definitive Guide](https://hashnode.com/posts/apex-background-page-processing-the-definitive-gude/66ec1d8a297094b056ab70b4)

[Joe Kerr](https://hashnode.com/@jkerr)

[Sep 22, 2024](https://hashnode.com/posts/apex-background-page-processing-the-definitive-gude/66ec1d8a297094b056ab70b4/comment/66ef5f60e3f72d0f3cbd3af4)

Very well done, and helpful.  
I have an IG using FOS plugin to add Menu Items to "Actions Menu" that trigger a custom event that causes a Dynamic Action to fire executing PL/SQL code using Primary Keys of currently selected IG rows and other page item values. I want to move the PL/SQL code to a background process and cause it to fire as one of the actions of the Dynamic Action. Ideas on how to do that? In short, how to fire a background Process from a Dynamic action that uses Page Item values? It seems it has to be a button click event? Or a submit, but then I lose which items were selected? Thoughts? Thanks Joe

[Jon Dixon](https://hashnode.com/@orclapex)

[Sep 22, 2024](https://hashnode.com/posts/apex-background-page-processing-the-definitive-gude/66ec1d8a297094b056ab70b4/comment/66ef5f60e3f72d0f3cbd3af4#reply-66f018c57240c6cd54f20c9d)

Hi Joe. For the background page process, you would have to submit the page and run a background page process, which is not what you want.

You could add the parameters to a table (and probably the session id), and launch an APEX Automation to run in the background (p\_run\_in\_background = TRUE). The Automation would pick the parameters up from the table and run your code.

```
APEX_AUTOMATION.EXECUTE (
    p_application_id    IN NUMBER DEFAULT {current application id},
    p_static_id         IN VARCHAR2,
    p_run_in_background IN BOOLEAN )
```

If you then need to pickup the results you can do so using the session ID.

Otherwise, you could go with DBMS\_SCHEDULER

```
BEGIN
   -- Create the job
   DBMS_SCHEDULER.create_job (
      job_name        => 'MY_SCHEDULER_JOB',
      job_type        => 'PLSQL_BLOCK',
      job_action      => 'BEGIN my_procedure(:param_value); END;',
      number_of_arguments => 1,
      start_date      => SYSTIMESTAMP,
      repeat_interval => NULL, -- Set if recurring; NULL for one-time execution
      enabled         => FALSE  -- Disable until arguments are set
   );

   -- Set the parameter for the job
   DBMS_SCHEDULER.set_job_argument_value (
      job_name   => 'MY_SCHEDULER_JOB',
      argument_position => 1, 
      argument_value    => 'Sample Parameter Value' -- This is the parameter you are passing
   );

   -- Enable the job (so it can run)
   DBMS_SCHEDULER.enable('MY_SCHEDULER_JOB');

   -- Optionally run the job immediately (without waiting for scheduled time)
   DBMS_SCHEDULER.run_job('MY_SCHEDULER_JOB');

END;
```

[Joe Kerr](https://hashnode.com/@jkerr)

[Sep 22, 2024](https://hashnode.com/posts/apex-background-page-processing-the-definitive-gude/66ec1d8a297094b056ab70b4/comment/66ef5f60e3f72d0f3cbd3af4#reply-66f05502ccc0f78100865258)

[Jon Dixon](https://hashnode.com/@orclapex) Hi Jon, Thanks for the quick and helpful options. I am thinking a good APEX Idea could be making it possible to fire a process with a custom event similar to DAs? Joe

[Joe Kerr](https://hashnode.com/@jkerr)

[Sep 24, 2024](https://hashnode.com/posts/apex-background-page-processing-the-definitive-gude/66ec1d8a297094b056ab70b4/comment/66ef5f60e3f72d0f3cbd3af4#reply-66f2e23cb20a3b7789d8dd10)

[Jon Dixon](https://hashnode.com/@orclapex) Hi Jon, FYI I went the dbms\_scheduler route, but setting argument values for a PLSQL\_BLOCK generates an error saying that type does not allow arguments. I handled it by pre-constructing the job\_action to build the parameter values into the job\_Action parameter value. Thanks again, Joe

[Jon Dixon](https://hashnode.com/@orclapex)

[Sep 24, 2024](https://hashnode.com/posts/apex-background-page-processing-the-definitive-gude/66ec1d8a297094b056ab70b4/comment/66ef5f60e3f72d0f3cbd3af4#reply-66f2f66dc414964eedbfc046)

[Joe Kerr](https://hashnode.com/@jkerr) makes sense.
