Apex_application.g_notification

Hi there,
I use a plsql procedure within a process so that the users can fill the category field for all selected customers (within an array) with a value from a list.
Sometimes this category value has already been set and it is not updated within the process, so I want to display a customized message afterwards, like '10 out of 15 companies updated'.
But as far I was only just using the Process Success/Error Messages. I've read about the apex_application.g_notification, but how and where to set it? Within the procedure?
Any help is appreciated,
thanks,
Lena

Hello,
>> I've read about the apex_application.g_notification, but how and where to set it?
As far as I know, you can’t set g_notification because this package variable is protected by checksum, which you can’t compute.
>> But as far I was only just using the Process Success/Error Messages
And what is wrong with that?
>> so I want to display a customized message afterwards
The Messages section supports substitution strings. You can set an application item to include your customized message, as part of your process, and use the *&NOTIFICATION.* notation in the proper message field.
Regards,
Arie.

Similar Messages

  • Apex_application.g_print_success_message

    Hi all..
    Please help me with the following issue.
    I have a PL/SQL process on a page (after submit process).
    I am using
    ""apex_application.g_print_success_message"" variable to show any error message.
    Ex: apex_application.g_print_success_message := 'Process failed at this step';It seems "apex_application.g_print_success_message" variable is for success messages .
    I want my "'error message"" to show in the same way as my ""validation error messages"" , as they are really ""error message"".
    I also tried to use ""apex_application.g_notification"" but it didn't worked. My message is not showing up.
    I tried to use the following code, but it seems it counts the error count
    only for the ""validation error messages"" , not the error message that i set in the process.
    {code}
    if nvl(apex_application.g_inline_validation_error_cnt,0) = 0 then
    <real code here>
    end if;
    {code}
    Thanks

    Hi Luis or anyone....
    Luis..Thanks for your replies regarding this issue.
    As i said in one of my previous step, I don't have option to move my code to ""validations""
    This is the overview of what my process do.
    begin
    -- do some steps
    call_database_procudre(return_code);
    if return_code = 'OK' then
    apex_application.g_print_success_message := 'Success mesasge';
    -- do other steps
    else
    apex_application.g_print_success_message := 'Fail Message'; """I want this one to show like ""error"" """
    -- How can i style it to show like in ""error message""" template.
    -- do other steps
    end if;
    {code}
    Anyone..PLease help me to solve this issue.
    Thanks                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • How to display Error Message in APEX from Database Stored Procedure

    Hello,
    Using APEX version 3.2
    DB version 9.2.0.8.0
    Internet Explorer version 6
    I have an After Submit Page Process that calls a stored procedure. In the exception section I'm using dbms_output.putline to display an error message, but the error message is not displayed in APEX. How can I have the error message generated from the stored procedure display in APEX?
    Thanks so much.

    Hi Apex_Noob,
    I created On Load - Before Header process that uses apex_application.g_notification := :P3_ROLE;I'm sorry but I'm not sure what you mean by "instead of using dbms_output.putline use :P1_ITEM"
    I have the following code in my stored procedure
    EXCEPTION
         WHEN OTHERS THEN
         dbms_output.put_line('Role does not exist');Thanks.

  • Custom authentication issue

    Good Afternoon,
    I am trying to add some code to a custom authentication routine to allow for tracking in the APEX supplied logs. Currently the authentication code processes the Login attempt and either allows access or returns the user back to the login page with a error message in case they entered an invalid username/password.
    I had added in each case the required two lines of code:
    APEX_UTIL.SET_CUSTOM_AUTH_STATUS('Test Message.. Ignore Me')
    APEX_UTIL.SET_AUTHENTICATION_RESULT(1) (Just as a test, will use more accurate values later)
    Now when I login with a non-existent user it logs it as a successful login, with NO custom text loaded...
    Can anyone suggest an idea here, other than using a custom logging table?
    Thank you,
    Tony Miller
    Webster, TX

    Hi,
    I did test set item session state , and it works OK for me.
    First I did forgot create that item when there was errors in my test.
    Do you have some computations, validations in login page ? Any application process that might run ?
    Or do you have any Page Sentry Function, Session Verify Function or Pre-Authentication Process in authentication scheme ?
    What is you session not valid in authentication scheme ?
    Have you tested your code on apex.oracle.com ?
    Br,Jari
    Edited by: jarola on Apr 16, 2010 9:25 AM
    I did more test.
    If you try login with some user name and password
    http://apex.oracle.com/pls/otn/f?p=12444
    Then you can try login with user EXPIRED and passwd test.
    To see access log login with user ACTIVE and passwd test.
    Then go page 10 you can see access log
    http://apex.oracle.com/pls/otn/f?p=12444:10
    My auth function is
    create or replace
    function                            custom_auth_2 (p_username in VARCHAR2, p_password in VARCHAR2)
    return BOOLEAN
    is
      l_password varchar2(4000);
      l_stored_password varchar2(4000);
      l_expires_on date;
      l_count number;
    begin
    -- First, check to see if the user is in the user table
    select count(*) into l_count from demo_users where user_name = p_username;
    if l_count > 0 then
      -- First, we fetch the stored hashed password & expire date
      select password, expires_on into l_stored_password, l_expires_on
       from demo_users where user_name = p_username;
      -- Next, we check to see if the user's account is expired
      -- If it is, return FALSE
      if l_expires_on > sysdate or l_expires_on is null then
        -- If the account is not expired, we have to apply the custom hash
        -- function to the password
        l_password := custom_hash(p_username, p_password);
        -- Finally, we compare them to see if they are the same and return
        -- either TRUE or FALSE
        0, 'AUTH_SUCCESS',
        1, 'AUTH_UNKNOWN_USER',
        2, 'AUTH_ACCOUNT_LOCKED',
        3, 'AUTH_ACCOUNT_EXPIRED',
        4, 'AUTH_PASSWORD_INCORRECT',
        5, 'AUTH_PASSWORD_FIRST_USE',
        6, 'AUTH_ATTEMPTS_EXCEEDED',
        7, 'AUTH_INTERNAL_ERROR',
        if l_password = l_stored_password then
          APEX_UTIL.SET_CUSTOM_AUTH_STATUS('SUCCEEDED');
          APEX_UTIL.SET_AUTHENTICATION_RESULT(0);   
          return true;
        else
          APEX_UTIL.SET_CUSTOM_AUTH_STATUS('WRONG_PASSWORD');
          APEX_UTIL.SET_AUTHENTICATION_RESULT(4);
           APEX_UTIL.SET_SESSION_STATE('LOGIN_MESSAGE','You have entered invalid Username or Password');
          return false;
        end if;
      else
        APEX_UTIL.SET_CUSTOM_AUTH_STATUS('ACCOUNT_EXPIRED');
        APEX_UTIL.SET_AUTHENTICATION_RESULT(3);
         APEX_UTIL.SET_SESSION_STATE('LOGIN_MESSAGE','Your account has been locked');     
        return false;
      end if;
    else
      -- The username provided is not in the DEMO_USERS table
      APEX_UTIL.SET_CUSTOM_AUTH_STATUS('USER_NOT_FOUND');
      APEX_UTIL.SET_AUTHENTICATION_RESULT(1); 
      APEX_UTIL.SET_SESSION_STATE('LOGIN_MESSAGE','You have entered invalid Username or Password');
      return false;
    end if;
    end;I have application item LOGIN_MESSAGE and in login page I did also create before header process.
    APEX_APPLICATION.G_NOTIFICATION := :LOGIN_MESSAGE;
    :LOGIN_MESSAGE := NULL;To show that item message in notification. It do not affect how auth work.
    It seems work ok

  • How to change the error message Invalid login credentials

    Hi all,
    How to change the default error messages .
    1) In the Login page while giving wrong username or password .It showing
    Error message "Invalid login credentials".
    But requirement is change the above error message.
    2) I need to change the error message instead of "1 error has occureed"
    Thanks in Advance
    Sudhakar

    On the Login Page of the application create a 'Before Header' process with this code if  apex_application.g_notification ='Invalid Login Credentials' then
             apex_application.g_notification :='Your Altered Failed Login Message Here';
      end if;varad

  • Auth result on Domino Webgate if Domino password expire

    Hi
    Appreciate if anyone can provide some input, tips regarding question below:
    How does the Domino webgate handle the situation where the user is authenticated and authorized
    successfully in OAM however their Domino accout password has expired? Does the webgate still
    simulate the Domino login?
    Domino account is the account associated with the OAM LDAP entry that is associated with the user logging
    i.e. the user account. In the case if pass the Domino DN of that user in the REMOTE_USER header variable.
    What happens when OAM user LDAP entry is able to authenticate, but the Domino account user
    password has expired? THANKS

    1. Create an application item :password_expired
    2. in the authentication scheme - post authentication process - set this item with some value if the password is expired.
    3. create an application process like this and make it conditional so it doesn't fire on the page you are using to inform the user about the password expiration (102 in this example)
    BEGIN
       IF :password_expired = 'Y'
       THEN
          HTP.init;
          OWA_UTIL.redirect_url (   'f?p=&APP_ID.:'
                                 || 102
                                 || ':&SESSION.:INFORM_EXPIRED::RP,::'
          HTMLDB_APPLICATION.g_unrecoverable_error := TRUE;
       END IF;
    END;4. On the information page create an onload process like this:
    BEGIN
       apex_application.g_notification := 'Your password has expired.';
    END;and make it conditional using PL/SQL Expression
    :REQUEST IN ('INFORM_EXPIRED')
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://apex.oracle.com/pls/otn/f?p=31517:1
    -------------------------------------------------------------------

  • APEX_APPLICATION.G_F01.. G_F50.. assigning sequence dynamically

    Hi,
    Can we generate F01 .. F50 numbers as mentioned below.
      declare
         v_seq number := 10;
         v1 varchar2(100);
      begin
         for i in 1..apex_application.g_f01.count
         LOOP
          v_seq :=  v_seq + 1;  -- v_seq will have value 11,12,13,..
          v1 := apex_application.g_f||v_seq||(i); -- CAN I DO LIKE THIS, I tried but getting error.
        END LOOP;
    so v_seq will have value with 11, 12, 13 each time and then I want to assign the following to v1
    apex_application.g_f11(i)
    apex_application.g_f12(i)
    apex_application.g_f13(i)
    apex_application.g_f14(i)
    So can I refer apex variables like above [G_F11, G_F12, GF13, ....]
    Thanks,
    Deepak

    DeepakJ wrote:
    Can we generate F01 .. F50 numbers as mentioned below.
    declare
    v_seq number := 10;
    v1 varchar2(100);
    begin
    for i in 1..apex_application.g_f01.count
    LOOP
    v_seq :=  v_seq + 1;  -- v_seq will have value 11,12,13,..
    v1 := apex_application.g_f||v_seq||(i); -- CAN I DO LIKE THIS, I tried but getting error.
    END LOOP;so v_seq will have value with 11, 12, 13 each time and then I want to assign the following to v1
    apex_application.g_f11(i)
    apex_application.g_f12(i)
    apex_application.g_f13(i)
    apex_application.g_f14(i)
    So can I refer apex variables like above [G_F11, G_F12, GF13, ....]No. This can only be done using dynamic PL/SQL: see +{message:id=9267909}+ for a previous example.

  • Apex_application.g_f01 picking up value of hidden column

    i have a report with a apex_item.checkbox using the id 1 and a hidden column. for some reason my pl/sql code that loops through apex_application.g_f01 picks up the value of the hidden column as well. why is this? is this a known bug?
    i managed to get my code working by using id 2.

    report code
    select ename,
    apex_item.checkbox(1,ename,null) sel,
    'RED' COLOUR
    from emp
    order by ename
    process
    FOR I in 1..APEX_APPLICATION.G_F01.COUNT LOOP
    //i insert into a test table to view results
    END LOOP;
    the above works fine until i change the COLOUR column from a standard column to a hidden column. Then for some reason the apex_application.g_f01 then includes the values of all ticked boxes plus all the values in the COLOUR column.

  • Apex_application.g_fXX and collection problem

    Hello all!
    In the midst of writing my second apex application, it appears I need to use apex_application functionality to meet my requirements and am seeking assistance.
    I have a table/report with a column link (item_id) and a second column (as a text field) (there are more columns displayed), but I think they are irrelevant to this situation) populated with a value QTY (c002) from a collection where c001 = item_id. What I'm attempting to do is allow someone to enter a qty in the c002 text field, apply the qty change to the collection and reload the page displaying the new quantity value in the report when the column link (image) is selected (page redirects to itself).
    Since it appears that column links are not a SUBMIT, I've put my collection update plsql in a before header process. According to the debug output, this collection insert is executed long before the rendering of the report.
    This is my report plsql;
    declare
    l_query varchar2(4000) := '';
    begin
    l_query := 'select i.INVENTORY_ID, col.c002, ql.QUANTITY_AVAILABLE, i.STRAIN_CODE, i.STRAIN_NAME, i.GENOTYPE, i.AGE, i.SEX, ql.ROOM_NUMBER from SM_INVENTORY i, SM_QUANTITY_LOCATION ql, apex_collections col where ql.STRAIN_ID = i.STRAIN_ID(+) and col.collection_name (+)= ''ORDER'' and col.c001 (+)= i.INVENTORY_ID';
    end;
    This is my update collection plsql (I don't have the insert part yet, but my collection already contains values);
    declare col_item_count number;
    col_seq number;
    item_id number;
    qty number;
    begin
    if apex_collection.collection_exists('ORDER') = FALSE then
    apex_collection.create_collection( p_collection_name => 'ORDER');
    commit;
    end if;
    for i in 1..apex_application.g_f01.count
    loop
    item_id := apex_application.g_f01(i);
    qty := apex_application.g_f02(i);
    select count(c001),seq_id into col_item_count, col_seq
    from apex_collections
    where c001 = item_id
    and collection_name = 'ORDER';
    group by c001, seq_id;
    if col_item_count > 0 then
    apex_collection.update_member(
    p_collection_name => 'ORDER',
    p_seq             => col_seq,
    p_c001 => item_id,
    p_c002 => qty);
    commit;
    end if;
    end loop;
    end;
    Given all this, my collection entry is not updated with the new value of c002 displayed in my report text field.
    Be advised, I've not found documentation about the apex_application package of sufficient detail to allow me to comprehend exactly what gets put into the apex_application.g_fXX values or when, but based on what I've gathered from examples/blogs, I think it contains the report in the currently rendered page, but I honestly don't know.
    Given my assumptions, I'm expecting apex_application.g_f01(1) would be the first row item_id of my report and apex_application.g_f01(2) would be the first row c002 (qty from my collection) of my report. If this is correct, I would expect this would work.
    What might I have missed?
    Thanks!
    Paul
    PS. Honestly, is this methodology the only/easiest way to get my requirement/functionality to work? Is there an easier way?

    OK, tried this - not yet successful. This is what I've got.
    Classic report loaded by;
    declare
    l_query varchar2(4000) := '';
    begin
    l_query := 'select i.INVENTORY_ID, i.INVENTORY_ID inv_id_hold, col.c002, ql.QUANTITY_AVAILABLE, i.STRAIN_CODE, i.STRAIN_NAME, i.GENOTYPE, i.AGE, i.SEX, ql.ROOM_NUMBER from SM_INVENTORY i, SM_QUANTITY_LOCATION ql, apex_collections col where ql.STRAIN_ID = i.STRAIN_ID(+) and col.collection_name (+)= ''ORDER'' and col.c001 (+)= i.INVENTORY_ID';
    end;
    Created a "SAVE" button.
    Set up column inv_id_hold as a hidden tab form element and col.c002 as a text field tab form element (item_id and qty respectively). These should now be available as apex_application.g_f01 and apex_application.g_f02 (right?).
    I have this post submit plsql in a process conditioned to the "SAVE" button.
    declare col_item_count number;
    col_seq number;
    item_id number;
    qty number;
    begin
    if apex_collection.collection_exists('ORDER') = FALSE then
    apex_collection.create_collection( p_collection_name => 'ORDER');
    end if;
    for i in 1..apex_application.g_f01.count
    loop
    item_id := apex_application.g_f01(i);
    qty := apex_application.g_f02(i);
    select count(c001),seq_id into col_item_count, col_seq
    from apex_collections
    where c001 = apex_application.g_f01(i)
    and collection_name = 'ORDER';
    --group by c001, seq_id;*
    if col_item_count > 0 then
    apex_collection.update_member(
    p_collection_name => 'ORDER',
    p_seq             => col_seq,
    p_c001 => item_id,
    p_c002 => qty);
    else
    apex_collection.add_member(
    p_collection_name => 'ORDER',
    p_c001 => item_id,
    p_c002 => qty);
    end if;
    end loop;
    end;
    When I enter something in my qty column and press SAVE, I get "ORA-01403: no data found" being thrown by the plsql process (per debug). Since everything is going on "under the hood" and there is no step debugger in apex, I'm not able to see/understand the process in action and determine where the problem is occurring.
    I got the idea for all of this here - http://apex.oracle.com/pls/otn/f?p=39839:3:5596350954563087::NO which is the shopping cart page of the online store application. But I'm trying to get the quantity edit portion to work on the inventory listing (so a customer can add items to an order simply by providing qty input for a particular line item(s) and saving).
    Any advice?
    Can you write an order processing system in apex that uses a collection to store line items?

  • APEX_APPLICATION.g_f01  not grabbing values

    Hi,
    Have the following problem with APEX_APPLICATION.g_f01
    I created a region with the following code:
    SELECT
    apex_item.text(1, CART_DETAIL#) as CART_DETAIL#ForCart,
    apex_item.text(2, SEQ, 1) as "#"
    FROM
    The item is displayed on the screen and changed by the user.
    when I save with:
    for i in 1..apex_application.g_f01.count
    loop
    cart_det.SEQ := apex_application.g_f02(i);
    commit;
    end loop;
    end;
    The value saved is what was loaded from DB and dos,'t include changes from the user.
    Any help would be appreciated
    Thanks,
    Arik

    Hi arik103, i´m having the same problem. I recommend you to first of all check if the apex_application.g_f01.count is really counting.. do this to check it.
    create a process "on load - After regions"
    whit this source.
    BEGIN
    htp.p(APEX_APPLICATION.g_f01.count);
    END;
    I don´t know why i´m having a similar problem. When i try to take the control of a report wich i create manually.. i can´t manipulate the report with the APEX_APPLICATION

  • Apex_application.g_fxx.count Question (problem?)

    Do the apex_application.g_fxx variables need to be shown on the page (region) in order for apex_application.g_fxx.count to return a non-zero value?
    I'm trying to figure out why I spent a day trying to get something to work, and it seems like this is what it was, though I'm not quite sure.
    In my report region, I have a column that when shown, my process works correctly, where a loop that has the form of:
    FOR i IN 1 .. APEX_APPLICATION.g_f16.COUNT
    LOOP
    This performs the statements within the loop.
    However, if that column is not shown (under Report attributes, unclick the Show box), then the process does not seem to execute the statements inside the loop.
    The only thing I can think of is that when it's marked as not shown, then the COUNT has no value, even though it seems like it should. Does COUNT only return the count of displayable items in the column, so if it's not shown, it's zero?
    It also may be how the report region is defined as well I suppose. It seems like ApEx should understand it okay, but who knows. It's simply a join of two inline views, so I can pre-populate the region with values from another table if this table didn't have any entries.
    This is Apex 2.2.1.00.04. One of these days I'll get caught up enough to upgrade to 3.0.
    Thanks,
    Bill Ferguson

    Hi Patrick,
    I suppose I also should have stated that this is a manually generated report region, using the apex_application.[item_type] syntax, where I have to specify the array (item) number. I just tested with Firebug, and if I change the number of the second column to 22, it's shown as f22 instead of f02.
    g_f16 was the next to the last column, though the one after it is a hidden column (apex_application.hidden).
    My report region is such, that g_f03 andg f16 are the only columns I can verify will actually have some data in it, as I force a value into gf16 if the second half of my union is selecting null values, so I could get around the null sorting problem (NULLS LAST didn't work, even on 10gR2, so I'm doing something else wrong).
    Anyway, I can use the values of the columns, whether they are displayed or not, it's just that apex_application.g_f16.COUNT always returned a zero when the column was hidden, even though it consisted of an array of 5 values. Trying to track it down I was able send the value of the column to a logging table, so I was able to see that I was getting the values, just not the count of values.
    Bill Ferguson

  • APEX_APPLICATION.G_F01(i)

    Hi
    I have an application that is sending emails to various users, who have specific information sent to them in the emails. what is happening at the moment is that when i check the checkbox for the 3rd person [APEX_APPLICATION.G_F01(i)]
    they get the information that is stored for the 1st person .
    the checkboxes are APEX_APPLICATION.G_F01(i), and the required information is in APEX_APPLICATION.G_F04(i). what i think is happening is that apex when it sees that i havent checked the first two checboxes, associates the remaining checkbox with row 1 APEX_APPLICATION.G_F04(i) as opposed to row 3 APEX_APPLICATION.G_F04(i)
    is their a way round this problem.
    declare
    l_to varchar2(1000);
    l_from varchar2(100):= '[email protected]';
    l_row varchar2(1000);
    l_message clob;
    begin
    FOR i in 1..APEX_APPLICATION.G_F01.count
    LOOP
    if (APEX_APPLICATION.G_F01(i)) is not null then
    l_to := replace(upper(APEX_APPLICATION.G_F01(i)),'acm.COM','acm.NET');
    l_message := (APEX_APPLICATION.G_F04(i),APEX_APPLICATION.G_F01(i));
    APEX_MAIL.SEND(P_TO => l_to,
    P_FROM => l_from,
    P_REPLYTO => null,
    P_BODY => l_message,
    P_SUBJ => 'This Email Is From The S.H.E. Department');
    end if;
    end loop;
    begin
    htmldb_mail.push_queue(p_smtp_hostname => 'xxx.xx.xx.xxx,p_smtp_portno => 25);
    end;
    end;
    Marco

    Marco,
    The code you posted will not work. Try this instead:
    DECLARE
       l_to        VARCHAR2 (1000);
       l_from      VARCHAR2 (100)  := '[email protected]';
       l_row       VARCHAR2 (1000);
       l_message   CLOB;
       v_seq_no    NUMBER;
    BEGIN
       FOR i IN 1 .. apex_application.g_f01.COUNT
       LOOP
          v_seq_no := apex_application.g_f01 (i);
          FOR c IN (SELECT    i.report_type
                           || ' '
                           || i.report_id
                           || ' '
                           || i.report_no
                           || ' '
                           || a.report_no
                           || ' '
                           || a.due_date
                           || ' '
                           || a.progress
                           || ' '
                           || a.last_update AS m1,
                           u.useremail AS m2, UPPER (SUBSTR (u.userid, 10))
                                                                           AS m3
                      FROM actions_tmp a, users_tmp u, incident_tmp i
                     WHERE a.actionee = u.userid(+)
                       AND i.report_id = a.report_id
                       AND NVL (a.progress, 0) < 100
                       AND (   a.last_email <>
                                        TO_DATE (SYSDATE, 'dd/mm/yyyy hh24:mi:ss')
                            OR a.last_email IS NULL
                       AND a.recommendation_comp IS NULL
                       AND i.report_id = v_seq_no)
          LOOP
             l_message := l_message || CHR (10) || CHR (10) || c.m1;
             l_to := l_to || ', ' || c.m3;
          END LOOP;
          l_to := LTRIM (l_to, ', ');
          apex_mail.send (p_to           => l_to,
                          p_from         => l_from,
                          p_replyto      => NULL,
                          p_body         => l_message,
                          p_subj         => 'This Email Is From The S.H.E. Department'
          htmldb_mail.push_queue (p_smtp_hostname      => 'xxx.xxx.xxx.xxx',
                                  p_smtp_portno        => 25
       END LOOP;
    END;Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://htmldb.oracle.com/pls/otn/f?p=31517:1
    -------------------------------------------------------------------

  • Problems using apex_application.g_fxx

    I have a SQL Query (updateable report) defined on a page and am using a custom app process to process the rows. I've based my code on posts out here but I'm getting some unusual results. Here's the sql for the report.
    SELECT
    NI_PROP_SEQ_NUM,
    NEW_ITEM_SEQ_NUM,
    APPROVED_REJECTED,
    APPROVED_REJECTED_BY,
    APPROVED_REJECTED_DATE,
    PROPOSAL_DATE,
    PROPOSAL_BY,
    PROP_FLD_LKUP_SEQ_NUM,
    PROPOSAL_FIELD_VALUE,
    case
    when PROP_FLD_LKUP_SEQ_NUM = 29 then
    (select nlsn_group_num || ' - ' || nlsn_ctgry_desc from apex_so.nlsn_ctgry where PROPOSAL_FIELD_VALUE = NLSN_CTGRY_NUM)
    else PROPOSAL_FIELD_VALUE
    end PROPOSED_VALUE
    from NI_PROPOSALS
    where NEW_ITEM_SEQ_NUM = :P2_NEW_ITEM_SEQ_NUM
    The report works fine on the page but when I try to process it using the following the values in the corresponding report don't align and is some cases I can't figure out where the values came from. Here's the code from the app process.
    DECLARE
    vRow BINARY_INTEGER;
    BEGIN
    :P2_RETURN_MESSAGE := 'This is a test, count = ' || apex_application.g_f01.COUNT;
    FOR i IN 1 .. apex_application.g_f01.COUNT
    LOOP
    vrow := apex_application.g_f01 (i);
    :P2_RETURN_MESSAGE := 'Inside the loop '
    || '. f01->'
    || apex_application.g_f01 (i)
    || '. f02->'
    || apex_application.g_f02 (i)
    || ' / f03->'
    || apex_application.g_f03 (i)
    || ' /f04-> '
    || apex_application.g_f04 (i)
    || ' / f05->'
    || apex_application.g_f05 (i)
    || ' / f06->'
    || apex_application.g_f06 (i)
    || ' / f07->'
    || apex_application.g_f07 (i);
    /* || ' / f08>'
    || nvl(apex_application.g_f08 (i), ' ');
    || ' / f09>'
    || nvl(apex_application.g_f09 (i), ' ')
    || ' / f10->'
    || nvl(apex_application.g_f10 (i), ' ')
    || ' / f11->'
    || nvl(apex_application.g_f12 (i), ' ')
    || ' / f12->'
    || nvl(apex_application.g_f12 (i), ' '); */
    END LOOP;
    END;
    There are 10 fields being selected in the sql above but if I try to concatenate more than g_f07 I get ora-1403 errors, data not found. None of these columns are null and I can't figure it out.
    Anyone have any thoughts?
    Thanks,
    Bruce

    Hi Bruce,
    is it possible that some of the columns are just of display type "Standard report column"? Because those will not save state.
    For an explanation of the apex_application.g_fxx array mapping, have a look at http://inside-apex.blogspot.com/2007/03/which-tabular-form-column-is-mapped-to.html
    Patrick
    *** New *** Oracle APEX Essentials *** http://essentials.oracleapex.info/
    My Blog, APEX Builder Plugin, ApexLib Framework: http://www.oracleapex.info/

  • [Solved] Reference apex_application.g_fXX in "execute immediate" statement

    Hi!
    I created a dynamically generated tabular form - the number of columns is not known in advanced. Each cell of the form is a text item generated with apex_item.text().
    I want to write an after-submit process that saves the values from the form into a database table. In this process I already know how many columns there are in the report so I want to do the following:
    --for each row...
    for i in 1..apex_application.g_f01.count loop
      -- and for each column in that row (number of columns is in v_col_count)
      for j in 1..v_col_count loop
        -- get the value of text item
        v_query := 'select apex_application.g_f0' || j || '(' || i || ')' || ' from dual';
        execute immediate v_query into v_value;
        -- now do some DML with v_value
      end loop;
    end loop;The problem is that I get an error: ORA-06553: PLS-221: 'G_Fxx' is not a procedure or is undefined where xx is the number from the generated query.
    My question is - am I doing something wrong or is is just not possible to reference apex_application.g_fxx in "execute immediate"? Will I have to manually check for all 50 possibilites of apex_application.g_fxx? Is there another way?
    TIA,
    Jure

    Well now I know what was wrong and what you were trying to tell me - apex_application.g_fxx is not visible in "plain" SQL. And now I also have a solution to this problem. The point is to wrap the select statement with begin - end block so that the statement is rendered as pl/sql:
    --for each row...
    for i in 1..apex_application.g_f01.count loop
      -- and for each column in that row (number of columns is in v_col_count)
      for j in 1..v_col_count loop
        -- get the value of text item
        v_query := 'begin select apex_application.g_f0' || j || '(:i)' || ' into :x from dual; end;';
        execute immediate v_query using i, out v_value;
        -- now do some DML with v_value
      end loop;
    end loop;This works great :).
    Jure

  • Problem with apex_application.g_fxx.count

    Okay, I am at my wits end on this one.
    I'm running Apex 4, and on one of my screens I have a manually created tabular report. For one of the master records, this tabular report returns 12 rows, yet apex_application.g_fxx.count consistently returns 24 as the count. For other master records, this is working correctly however, returning the same number as what is showed on screen.
    I've tried to duplicate it on apex.oracle.com, but it works correctly there as well.
    I've checked the data table, and there are only twelve rows there, same as what the tabular report shows. I've added in TONS of code to report back what is happening and everything looks fine in the code and processing, but the data that gets saved is out out sync, since it appears that for some reason the xxx.count (for only this one master record) is somehow doubling the count, so the data that gets saved is off. For example, say someone makes a change to the third sub-record, the 'count' suddenly becomes 6, so it saves the changes for the sixth sub-record.
    Has anybody else ever seen this phenomenon and knows what causes it? I've spent three fruitless days trying to track this down so far.
    Thanks,
    Bill Ferguson
    A bit of further information.
    In my app, users must list all commodities present at a site first (different screen). They may then go to my Resources screen and input the tonnage and grades of the various commodities present. This ensures that users cannot add tonnage and grade information for a commodity that is not listed as being present at the site.
    So, when they get to the Resources screen, the bottom is all filled out with all of the commodities listed, and they simply have to type in the grade. The users also wnated the ones with information in the grade fields to appear at the top, so I had to add an order by to the query, as follows:
    SELECT a_rec,
           c_code,
           import,
           item,
           grade,
           grade_units,
           child_key,
           count_order
      FROM (SELECT rec a_rec,
                   c.commod || ' - (' || code || ')' c_code,
                   c.import,
                   item,
                   grd grade,
                   grd_units grade_units,
                   child_key,
                   rec count_order
              FROM    RESOURCE_DETAIL rd
                   RIGHT OUTER JOIN
                      commodity c
                   USING (dep_id, code)
             WHERE (CHILD_KEY = 1028244420100003)  -- actually using a variable here instead of hard-coded values
            UNION
            SELECT c.line a_rec,
                   c.commod || ' - (' || code || ')' c_code,
                   import,
                   NULL item,
                   NULL grade,
                   NULL grade_units,
                   NULL child_key,
                   c.line + 200 count_order
              FROM commodity c
             WHERE dep_id = 10282444 -- actually using a variable here instead of hard-coded values
                   AND code NOT IN
                          (SELECT code
                             FROM resource_detail
                            WHERE dep_id = 10282444 AND yr = 2010 AND line = 3)) -- actually using variables here instead of hard-coded values
    ORDER BY import, count_orderNow, on the screen the commodities are listed as:
    Copper
    Gold
    Molybdenum
    Silver
    Gemstone
    Lead
    Zinc
    Uranium
    Gypsum
    REE
    Talc
    Garnet
    But, the code I've added to see what is happening is instead saying the records being processed are in this order:
    Copper
    Garnet
    Gemstone
    Gold
    Gypsum
    Lead
    Molybdenum
    REE
    Silver
    Talc
    Uranium
    Zinc
    I do not have any sort criteria specied in the Report attributes. So, why is the order of processing (for i in 1 .. apex_application.g_f03.count) processing in a different order than what is shown on screen?

    Hi Arie,
    This was a strange one to track down. I wound up adding all kinds of logging statements in my code, writing things out to a table while processing, counts, which record, etc., and suddenly it dawne don me that everything was being processed in alphabetical order by commodity name, even though the screen display was by two other fields. I played around with different 'order by' settings, but the processing somehow was always by the commodity name. I have no idea where it was getting that 'directive', but nothing I could figure out changed it.
    So to recap, in case I didn't explain it well enough above, this is a manually created tabular form, with a 'regular' form above it (master-datail). I use the apex_item.text, etc. constructs to create the tabular form, and then in my 'proceses' I'm using the normal apex_application.g_fxx array to perform the processing. While the screen display from the tabular report shows everything with an order by of two columns, the processing always was done ordered by a diffierent, no-specified column.
    Changing my report definition to use the same 'order by' as the processing seemed to be working fixed the problem, though I have no idea where it was getting the 'order by' from to overwrite what was being on screen. I'm not sure if this is a bug or not, I vaguely remember Scott Spadafore commenting about this behaviour a long, long time back, but I can't find the post. It was probably back in the 2.x days.
    I also have no idea what is causing the array to somehow double for some records and not on others. In this particular case, the record I had on screen only had 7 commodities, but when I printed the result of apex_application.g_fxx.count, it always showed 14, even though on apex.oracle.com, when I tried to re-create the problem, it worked correctly and only reported 7. Most records in my database that I tested this on worked correctly, reporting the correct number of commodities, but occasionally I'd run across one where the number was doubled. I don't know if there is some internal table Apex uses that I could truncate (like possibly wwv_flow_collection_members?) where possisbly this type of information be kept. The only thing I can think of is that somewhere these counts are stored in a collection and it is populated with data from a real old incarnation, and during processing it stumbles across these old records and uses the old values. It doesn't seem like a realistic possibility, but it about the only explanation I can think of.
    Bill Ferguson

Maybe you are looking for