Application process JavaScript

Hello

I want to run a JavaScript application process to update a table.

JavaScript:
function update_seq() {}
get var = new htmldb_Get (null,
& APP_ID.,.
'APPLICATION_PROCESS is update_rep_seq',
(0);

gReturn = get.get ();
get = null;
}

At the request of PL/SQL
BEGIN
INSERT INTO jmv_temp VALUES (SYSDATE, "in_process");
COMMIT;
EXCEPTION WHEN OTHERS THEN
HTP.p (' error: ' |) SQLERRM);
END;

If I run the process from a URL, it inserts my record.
.../f?p=500:4:465882208613569:APPLICATION_PROCESS=update_rep_seq

If I call the JavaScript from an element to the file didn't get inserted. Finally, I wish to pass parameters to do an update on a table.

No idea why the JavaScript call does not work?

Thank you

Melvin

Hello:

Try if change the last parameter in the 'htmldb-get' call from 0 to 4 makes a difference

CITY

Tags: Database

Similar Questions

  • Call javascript application process

    I use 5 APEX. I have a page that I use a button to call js and dynamic action.

    I created the button on my page with action "Defined by the dynamic Action" and static id "ajax".

    I added this js on my page 'function and declaration of global variables ' section:

    $('_#ajax').click (function () {}

    var ajaxRequest = new htmldb_Get (null, & APP_ID., 'APPLICATION_PROCESS is getId', 0);

    var ajaxResult = ajaxRequest.get ();

    Alert (ajaxResult);

    $.ajax({)

                 url: " http://10.25.7.84/WS/selectionService/currentSelection/student ",

    type: 'POST',

    data type: 'json ',.

    contentType: "application/json",

    data: ' {'mode': 'set', 'ID': "[" + ajaxResult + "]","page": 1, "pageSize": 20 "}'

    });

    Alert (' we need to find a better message - value current selection complete ');

    });

    I have created a process called 'getid ':

    DECLARE

    p_app_id NUMBER: = 100;

    p_page_id NUMBER: = 13;

    BEGIN

    ...

    END;

    2 questions:

    (1) I want this application process to be reusable for multiple pages/applications, so I need to replace the hard-coded "p_app_id", "p_page_id" with something I can put on each page. What is the best way to do it? Elements of the application? How and where should I set up on the page?

    (2) in my js, I don't want to hard-code the IP address in the URL.  url: "http://10.25.7.84/ws/selectionservice/currentselection/student". "" Y at - it something that I can use so that it uses the IP that APEX was running on?

    Hi bobmagan,

    bobmagan wrote:

    I tried, but it doesn't seem to work. The application process worked when I had coded the 2 variables. Don't know if its something in the code, that's why I've included pieces that use 'p_app_id' and 'p_page_id '.

    You can access the app ID and the ID of the Page in javascript and send it to your AJAX process as follows:

    • JS code:
    $('#ajax').click(function(){
        var ajaxRequest = new htmldb_Get(null,&APP_ID.,'APPLICATION_PROCESS=getId',0);
        ajaxRequest.addParam('x01',$x('pFlowId').value);
        ajaxRequest.addParam('x02',$x('pFlowStepId').value);
        var ajaxResult  = ajaxRequest.get();
        //alert(ajaxResult);
        $.ajax({
            url: "http://10.25.7.84/ws/selectionservice/currentselection/student",
            type: "POST",
            dataType: "json",
            contentType: "application/json",
            data: '{"mode":"set","ids":"[' + ajaxResult + ']","page":1,"pageSize":20}'
        });
        //alert('We need to find a better message - Set Current Selection Complete');
    });
    
    • AJAX PL/SQL process:
    DECLARE
    
        p_app_id   NUMBER := APEX_APPLICATION.G_X01;
        p_page_id  NUMBER := APEX_APPLICATION.G_X02;
    
    BEGIN
      ...
    END;
    

    Kind regards

    Kiran

  • Pass the parameter to the javascript application process

    I'm trying to pass a parameter to an application process from javascript and don't know how to do this. What I want to accomplish is to create checkboxes to delete several records at once. Before these records can be deleted, I need to make sure that the resource_type_id is not used. To do this, I call a javascript function with an onchange event that calls an application process to perform a database search. I have included the code to create the boxes and the JavaScript below. I am new to APEX, so there may be a way easier and better to do. Any help or suggestion about a better way to proceed would be appreciated.

    Thank you!

    Creation of boxes *.

    SELECT APEX_ITEM. CHECKBOX (20, RESOURCE_TYPE_ID, 'onchange = "CheckUsed (this.value)" '; ':') "Delete", RESOURCE_TYPE, APEX_ITEM.text(10,RESOURCE_TYPE_ID) RESOURCE_TYPE_ID
    OF resource_types
    ORDER BY RESOURCE_TYPE



    < script language = "JavaScript1.1" type = "text/javascript" >
    function CheckUsed (id)
    {

    get var = new htmldb_Get (null, $x('pFlowId').value, 'APPLICATION_PROCESS is ResourcesResourceTypeExists', 0);

    Alert (Get.get ());
    }

    NP, help!

    Andy

  • The clarification of application process

    Hello

    I am faced with a simple application process in the apex 4.2 version

    I have a page - which has a javascript function:

    clearMessage (ITAC) function

    {

    get var = new htmldb_Get (null, & APP_ID., 'APPLICATION_PROCESS is assignment_update', & APP_PAGE_ID.);

    get.addParam = ("x 01', CITA);

    var output = get.get ();

    obj = jQuery.parseJSON (output);

    Apex. Submit({Request:'submit',showWait:true});)

    }

    With an application on request process:

    declare

    l_value varchar2 (200): = wwv_flow.g_x01;

    Start

    app_public.assignment_update (l_value,

    : APP_ID,.

    : APP_PAGE_ID,.

    (: APP_USER);

    end;

    The problem is when the procedure works - he goes l_value with a null value.

    Why pointers that will help a lot!

    Thank you very much

    JAS

    Hello

    Just for info. Do not use undocumented htmldb_Get JavaScript function.

    You must use apex.server.process.

    Kind regards

    Jari

  • To access the settings of ajax in the application process

    Hello

    I have an ajax call, submitting a parameter called cBoxKey.

       var get = new
       htmldb_Get(null,$v('pFlowId').value,'APPLICATION_PROCESS=TrackRows',0);
       get.add('cBoxKey','NOTREQUIRED');
      get.get();
    
    

    In the application process I can access the parameter 'cBoxKey' like below;

    declare
        l_checkBoxKey  varchar2(4000);  
    begin
        --
        -- Get the value of the global which will be set in JavaScript
        --
        l_checkBoxKey := wwv_flow.g_cBoxKey;
    
    

    However, this does not seem to work because when I replace

    l_checkBoxKey := wwv_flow.g_cBoxKey;
    
    

    with

    l_checkBoxKey := 'NOTREQUIRED';
    
    

    The application process is called and produces results (through the ajax call).

    In my view, that the question is how access the "cBoxKey" parameter in the application process.

    Any ideas on what could be wrong.

    Thank you.

    Hello

    I check any specification of package APEX version wwv_flow, there is no variable of g_cBoxKey.

    If you have idea there?

    Change your JavaScript for

    var get = new
    htmldb_Get(null,$v('pFlowId').value,'APPLICATION_PROCESS=TrackRows',0);
    get.addParam('x01','NOTREQUIRED');
    get.get();
    

    And then access process on demand as

    l_checkBoxKey := APEX_APPLICATION.g_x01;
    

    Kind regards
    Jari

  • Show/hide a Div so that the application process will be executed

    Hi all

    I have the following problem:
    I'm on APEX 3 and I have the page with 2 elements. When the user, enter the value in the first element on the page and navigate out of the element, in the second article should be the SYSDATE.
    This must be done as:
    1. set the fovus in the Item1.
    2. navigate off the Item1 (with TAB or the mouse).
    3 JavaScript function will be executed:
    3.1 icon "Please wait...". "will be displayed.
    3.2 application of getDbDate process will be executed.
    3.3 the value returned by the getDbDate of application process is allowed in the Field2.
    3.4 icon "Please wait...". "disappears.

    Here ist the sample application: http://apex.oracle.com/pls/otn/f?p=MISCELLANEOUS:108

    In Firefox, I have no problems to show the "Please wait...". "Icon, but the Explorer Intener shows me nothing. But the application process will be executed.

    Any ideas?

    Best regards

    Hello

    See the example of CARL
    http://HTMLDB.Oracle.com/pls/OTN/f?p=11933:62

    Kind regards
    Jari
    -----
    My Blog: http://dbswh.webhop.net/dbswh/f?p=BLOG:HOME:0
    Twitter: http://www.twitter.com/jariolai

  • Application process, do not run after the validation error

    Hi all.

    APEX 4.1
    XE 11 GR 2
    WIN7
    Firexfox

    I have a page where I add additional javascript code to a page by using htp.p in a process of application "before the footer. It works fine as long as there is no validation error. When the validation fails (for example a UK-check with the location of the error value "Inline notification"), the page is re-fondue, but the application process is not running and so my extra code is missing from the page.

    Is this intended behavior or am I doing something wrond?

    Andreas

    Addition:

    I tried the sam using a 'local' page process, but these do not seem to fire.

    Published by: Andreas Weiden on 22.12.2011 21:31

    Andreas Weiden says:

    Is this intended behavior or am I doing something wrond?

    This is the expected behavior. Generally, the process and calculations source item, the actions are not executed when the page is re-made after validation errors. They also provide great potential for confusion of side effects (for example reset to a default value for an item that had an invalid value sent).

    However, the engine provides a special treatment for the process with the built-in Inline Validation errors displayed condition so that they will be run when a page is rendered with validation errors. See + {: identifier of the thread = 493070} + for an interesting discussion on this topic.

    An alternative (and in my opinion a more classic and rather more clear) would be to generate the JS in a dynamic region of PL/SQL code on the Page zero. Always reuse the code on all or several pages, but is more clearly part of the rendering of the page as an application process and does not rely on a very obscure condition, being the only way you can make it work.

  • using the value of the point of application in javascript

    Hi all

    Apex 3.1

    I have a javascript that calls an application process, please see below. In the application process, I have create/modify the value of an element of the application logic. Later in the javascript, I need to define a page element to the value of the application element that has been created in the application process. All of the alerts that I post for the javascript display this value as empty, even though a similar HTP.prn in the process of the application displays the value! Once the completed script the correct value of the issue of enforcement is in session state. Can someone explain this problem of sync for me? Why can't I get the value of an element of application in javascript code when the application process is called by the javascript code?

    Is there a simple solution for me to get this value?
    <script>
    function f_ValidateLinkLine(pThis) {
        
       // The row in the table
       var vRow = pThis.id.substr(pThis.id.indexOf('_')+1);
       
       // is Link Line really a number?  
       if ( isNaN(html_GetElement('f20_'+vRow).value)) {
            if (html_GetElement('f20_'+vRow).value.length > 0) {
            alert('Link Line is an invalid number - '+html_GetElement('f20_'+vRow).value);
            html_GetElement('f20_'+vRow).value = '';
            }
       } else {  
           if ( ! isNaN( parseFloat(html_GetElement('f20_'+vRow).value) ) ) {
    
       var link_line = parseInt(html_GetElement('f20_'+vRow).value);
    
       if (html_GetElement('f20_'+vRow).value.length > 0) {
    
          var get = new htmldb_Get(null,&APP_ID.,'APPLICATION_PROCESS=ValidateLinkLine',0);
          get.add('F101_LINK_LINE',html_GetElement('f20_'+vRow).value);
          get.add('F101_INVENTORY_ITEM_ID',html_GetElement('inventory_item_id_'+Number(link_line)).value);
          get.add('F101_QUOTE_LINE_LINK_ID',html_GetElement('f01_'+spacer+link_line).value);
          get.add('F101_QUOTE_LINE_ID',html_GetElement('f01_'+vRow).value);
          get.add('F101_QUOTE_NUMBER',html_GetElement('f19_'+vRow).value);
    
          gReturn = get.get();
    
    
       // The application process can sometimes change the value of F101_QUOTE_LINE_ID
      //  and I need to set f37 to this value when this happens
    
        html_GetElement('f37_'+vRow).value =('&F101_QUOTE_LINE_ID.');  //< -- This does not work, the applicaiton item is blank!
     
          if (gReturn) { 
           alert(gReturn);
          }
     
          if(gReturn) { 
           html_GetElement('f20_'+vRow).value = '';
           html_GetElement('f37_'+vRow).value = '';
          }
    
       }  //End Check Length
    
      } else {
    
      html_GetElement('f37_'+vRow).value = '';
    
      } // is Link Line a number?    
     
     } // End If   
    
    } // End ValidateLinkLine
    
    </script>
    Published by: blue72TA on August 16, 2011 11:39

    Published by: blue72TA on August 16, 2011 11:41

    Published by: blue72TA on August 16, 2011 11:41

    Hello

    When you use the point of application in JavaScript, as you do, string &. F101_QUOTE_LINE_ID is replaced by the value of the session state.
    Changes to this value of the item when you call process On Demand do not affect the page.

    Lets take for example,
    You app element value of F101_QUOTE_LINE_ID is for example XX in session state.
    You run the page and view the source of the page that looks like this

    html_GetElement('f37_'+vRow).value =('XX');
    

    Like you have a value hard to JavaScript code.

    Nothing can change this, unless you refresh the page.

    You need return the value of the process On Demand.
    To set the value of code might look like so

    html_GetElement('f37_'+vRow).value = gReturn;
    

    Kind regards
    Jari

  • Sending page apex to the application process (JSON) values

    Hi all

    A page 5 apex has a value in a hidden item, P5_CLASS
    In the apex 5 page, I wrote a JavaScript to call for a process of application (PL/SQL) to retrieve the values of a table on Page 5.
    var ajaxRequest = new htmldb_Get (null, & APP_ID., 'APPLICATION_PROCESS is Get_Class_Data', 0);
    and I use the JSON object to display the rows in the table.
    -----------
    Problem
    -----------
    It works pretty well. But I need to send the value of the hidden element P5_CLASS to Get_Class_Data so that I can ask P5_CLASS-basedapplication process.

    Help, please.

    Shiva says:
    Thank you Paul,.

    So I can use

    var ajaxRequest = new htmldb_Get (null, & APP_ID, 'APPLICATION_PROCESS = GET_CLASS_DATA', 0);
    ajaxRequest.add ('F15_GLOBALVAR', $v ("#P5_CLASS")) to send the value to the application process?

    (F15_GLOBALVAR is an application-level element, I created in the shared components)

    And to use this application in my sql in GET_CLASS_DATA, I can use sql... where class =: F15_GLOBALVAR?

    Yes.

    (Please zip code wrapped in \

    ...\
    

    Tags to preserve the special characters and formatting.)

  • How to keeps it external links in the application process?

    I have an application that has production, development and test environments. I need to incorporate some external tool URL in APEX and APEX page javascript code pl/sql/menu code links how to respective production, development and test environments in external tools. It is very difficult to change these links manually everytime we Nettwerk enforcement around different environments. is it possible to define an application process where these links are accessible by code APEX page javascript and links of menu/code APEX pl/sql, so that I can change the links in one place? any ideas are appreciated.

    Kind regards
    Surya

    Hello

    To list the target URL place you

    &SERVER_NAME.
    

    Kind regards
    Jari

  • Application process

    I wrote the application process, as shown below. This application process gives correct results on page 6, but did not write anything on page 9

    ----------------------
    DECLARE
    l_price VARCHAR2 (200);
    BEGIN
    SELECT CIRM_CUR_PRICE
    IN l_price
    OF CM_ITEM_RM
    WHERE CIRM_CODE =: P6_CRI_CIRM_CODE;

    HTP.prn (l_price);

    EXCEPTION
    WHILE OTHERS
    THEN
    HTP.prn (sqlerrm);
    END;
    ------------------------------------

    < script language = "JavaScript" type = "text/javascript" >
    htmldb_delete_message = "'DELETE_CONFIRM_MSG" ";
    function f_getPrice () {}
    lVal var = $v ('P9_CRI_CIRM_CODE');
    get var = new htmldb_Get (null, & APP_ID, 'APPLICATION_PROCESS = GET_RM_PRICE', 0);
    Get.Add ('P9_CRI_CIRM_CODE', lVal);
    var gReturn = get.get)
    {if (gReturn)}
    $x_Value ('P9_CRI_RM_COST', gReturn);
    } else {}
    $x_Value ('P9_CRI_RM_COST', ");
    }
    get = null;
    }
    < /script >

    ------------------------------------------------------------------------------------

    Is - this statement - "WHERE CIRM_CODE =: P6_CRI_CIRM_CODE;" to get the result on page9 i.e P9_CRI_RM_COST

    Will I change the statement
    "WHERE CIRM_CODE =: P9_CRI_CIRM_CODE '?"

    Yogesh

    In the application process, you are referring point page6, P6_CRI_CIRM_CODE. So he can't see the value of the element page9

    >

    Will I change the statement
    "WHERE CIRM_CODE =: P9_CRI_CIRM_CODE '?"

    If you change it, it won't work on page6.

    So create a demand item, say P_CRI_CIRM_CODE.

    In your JS page6 change

    get.add('P6_CRI_CIRM_CODE',lVal); 
    

    TO

    get.add('P_CRI_CIRM_CODE',lVal); 
    

    in your change JS page9

    get.add('P9_CRI_CIRM_CODE',lVal); 
    

    TO

    get.add('P_CRI_CIRM_CODE',lVal); 
    

    And change the query in the application process

    SELECT CIRM_CUR_PRICE
    INTO l_price
    FROM CM_ITEM_RM
    WHERE CIRM_CODE = :P_CRI_CIRM_CODE;
    

    Kind regards
    Hari

    Published by: Hari_639 on November 30, 2009 16:23

  • Generic procedure for the development of the item application of javascript?

    For now, all I can think about is a javascript function call to an application process, which looks like this:

    function setVariableValue (pName, pValue) {}
    var gReturn;
    get var = new htmldb_Get (null, $x('pFlowId').value, 'APPLICATION_PROCESS is odpSetVariableValue', 0);
    get.addParam('x01',pName);
    get.addParam('x02',pValue);
    gReturn = get.get ();
    get = null;
    }

    odpSetVariableValue
    Start
    immediate execution ':' || wwv_flow.g_x01 | ' := ' || wwv_flow.g_x02;
    end;

    Is there a function of APEX to do without "immediate execution"?

    Igor

    Hello Igor.

    I think you can do the same thing without actually executing a PL/SQL process (see here for an example).

    function setVariableValue (pName, pValue) {}
    get var = new htmldb_Get (null, $x('pFlowId').value, 'APPLICATION_PROCESS is dummy', 0);
    Get.Add (pName, pValue);
    var gReturn = get.get ();
    get = null;
    }

    (The dummy application process are really...)

    Greetings,
    Roel

    http://roelhartman.blogspot.com/
    http://www.bloggingaboutoracle.org/
    http://www.Logica.com/

    You can assign this answer to your question in marking it as useful or Correct ;-)

  • AJAX and APEX wooes application process

    I have an interesting problem where JavaScript is running and that it not postbacks, as I confirmed this by looking at the html via Firebug events but On Demand process does not (confirmed through a debugging log table). What has to be really puzzled is that right after I created the application process, it worked perfectly up until some time after I left the game and returned. Can anyone offer any suggestions?



    JavaScript in the Page header:
    <script language="JavaScript" type="text/javascript">
    function f_checkid ()
    { 
      var get = new htmldb_Get(null,$x('APP_ID'),'APPLICATION_PROCESS=CheckID',0);
      get.add('P20_STAFF_ID',html_GetElement('P20_STAFF_ID').value)
      gReturn = get.get();
      if(gReturn)
        {
    var sepPos = gReturn.indexOf("|");
      html_GetElement('P20_STAFF_PIDM').value = gReturn.substr(0,sepPos);
    html_GetElement('P20_NAME').value = gReturn.substr(sepPos+1);
    }
        else
        {  html_GetElement('P20_NAME').value = 'Invalid: None Selected or ID is Invalid!'  }
      get = null; 
    }
    </script>
    Request for application process:
    Name: CheckID
    DECLARE
       idn   varchar2(1000);
    id number(8);
    BEGIN
    SELECT FUNCTIONS.PROCESSID(:P20_STAFF_ID) INTO id FROM DUAL;
       SELECT TO_CHAR(id) || '|' || FUNCTIONS.GETNAME(id)
         INTO idn
         FROM dual;
       IF(TRIM(REPLACE(idn,'|','') IS NOT NULL) then
       HTP.prn (TRIM(idn));
    end if;
    INSERT INTO DEBUG (VAL1,VAL2) values (idn, id);
    commit;
    END;
    JavaScript function is triggered onBlur in P20_STAFF_ID.

    Hello

    Are you sure that your code in the process is correct

    This line seems incorrect to me
    IF (Trim (Replace(IDN,'|','') IS NOT NULL) then)

    It should instead be
    IF TRIM (REPLACE (idn,'|)) ((', ") {color: #ff0000} *) * {color} IS NOT NULL then

    Because I think that you close your clause works

  • My task manager only to see the task and not, application, process, etc. How can I get it back to normal?

    My task manager only to see the task and not, application, process, etc. How can I get it back to normal?

    If it does not display all the tabs, double-click the external border of the Task Manager.

  • Get all the hidden Application processes

    Hi all

    There are Application processes that are running on Blackberry which are not visible Application. In the application manager, we can get only visible applications. How do we get all processes including hidden processes? What api gives all processes other than ApplicationManager?.

    Thanks in advance

    Have you seen this?

    http://kisses.zensay.com/

    Developer says he is gong to open source its code at some point.

Maybe you are looking for

  • iTunes 12.5.1.21: mouse offset

    I installed 12.5.1.21 on Windows 7 Enterprise 64-bit SP1 and now my mouse clicks are disabled by like a couple of centimeters. By off I say that when I place my mouse cursor on a title of the song is the song below, or two song belong who gets highli

  • Explanation of the keyboard keys

    What is there of nowhere that the keys of the keyboard on a HP Pavilion series g can be explained to me.   There are a lot of buttons that I don't use, but can be useful if only I knew what function they perform.

  • HP Envy 17-n009a: windows 10 hp envy 17-n009a

    The Integrated Intel Graphics HD5500 reports as being compatible with the blu - ray, (it is not possible to pass the 940 m Nvidia on this machine). But the driver of Windows 10 Intel HD5500 reports as not not compatible? (Using the latest driver on t

  • touchpad no longer responds to pressures on

    Have 2 computers Hp Pavilion (dv6700 and dv6000). Both have problems with the TouchPad don't respond not to the taps after start and all programs are loaded on the desktop. The dv6700 worked with faucets slightly so that following an update for Synap

  • Why when I backup after selection keep only last system only the old image image is maintained?

    Why when I backup after selection keep only last system only the old image image is maintained?