Patrick wolf's apexlib_tabform is misbehaving

Hi Fellow APEX developers,
I'm trying to implemented a 'logical delete' functionality in APEX 3.1, i.e. mark a record as deleted by updating a a database table column but not phyically delete it. I have a tabular form with default row selector which I am trying to interogate using the code below.
The code below is copied and amended from Patrick Wolfe's web site. It belongs to a APEX On-submit- After Computations and Validations process and is called by a new manually created Delete button.
The update statement is not being executed at all. The process is being executed when the button is pressed I've checked in Debug.
I hope someone can shed some light on this.
Thanks in advance.
Regards,
Austin
-- Used to perform a 'Soft' or 'Logical' delete of a sales_contact record
-- that is marked deletion.
-- Do NOT physically DELETE a record that is marked for deletion.
DECLARE
v_sales_contact_id sales_contact.sales_contact_id%TYPE;
BEGIN
FOR v_index IN 1 .. ApexLib_TabForm.getRowCount LOOP
IF ApexLib_TabForm.hasRowChanged(v_index) THEN
IF apexlib_tabform.isrowselectorchecked(v_index) THEN
v_sales_contact_id := APEXLIB_TABFORM.nv('SALES_CONTACT_ID'
,v_index);
UPDATE sales_contact sc
SET sc.termination_date = SYSDATE
WHERE sc.operator_id = v_sales_contact_id;
END IF;
END IF;
END LOOP;
END;

Hi All,
From my investigations the arrays used in apexlib_tabform are not being initialised when I set a row for deletion using (the default row selector).
I've also googled and searched the web for apexlib_tabform entries and found the following : http://www.inside-oracle-apex.com/2006/12/drop-in-replacement-for-v-and-nv.html
I've followed the instructions on the url above and still no success..
If anybody has encountered this issue please let me know how you resolved them.
Regards,
Austin

Similar Messages

  • Problems implementing Patrick Wolf's reCAPTCHA

    I've attempted to implement Patrick Wolf's captcha paradigm at http://www.inside-oracle-apex.com/adding-captcha-to-your-oracle-apex-application/ to no avail.
    The required "checkRecaptcha" function has been uploaded to my schema.
    Depending on where I place the page items or the javascript code, I get one of the following errors;
    HTTP-404 \nwwv_flow.accept: SIGNATURE (parameter names) MISMATCH\nVARIABLES IN FORM NOT IN PROCEDURE: UNDEFINED\nNON-DEFAULT VARIABLES IN PROCEDURE NOT IN FORM: \n
    HTTP-404 \nwwv_flow.accept: SIGNATURE (parameter names) MISMATCH\nVARIABLES IN FORM NOT IN PROCEDURE: UNDEFINED,RECAPTCHA_RESPONSE_FIELD\nNON-DEFAULT VARIABLES IN PROCEDURE NOT IN FORM: \n
    HTTP-404 \nwwv_flow.accept: SIGNATURE (parameter names) MISMATCH\nVARIABLES IN FORM NOT IN PROCEDURE: RECAPTCHA_CHALLENGE_FIELD\nNON-DEFAULT VARIABLES IN PROCEDURE NOT IN FORM: \nAt this point, I have a dedicated region containing the captcha related page items (only ones in the region) with the javascript in the region source. This arrangement does not work (same types of errors).
    I'm a fairly novice apex developer and the difficulty is understanding what these errors mean, how they are caused or how to troubleshoot them. I've extensively visited support.oracle.com and google and have found no clear explanation on the nature of these errors and what causes them. I'm happy to admit I'm asking the wrong questions in the wrong places...
    Hopefully one of you folks out there can offer advice.
    Many Thanks!
    Paul
    PS - more details of error...
    Wed, 24 Nov 2010 17:50:34 GMT
    wwv_flow.accept: SIGNATURE (parameter names) MISMATCH
    VARIABLES IN FORM NOT IN PROCEDURE: UNDEFINED
    NON-DEFAULT VARIABLES IN PROCEDURE NOT IN FORM:
      DAD name: strainint
      PROCEDURE  : wwv_flow.accept
      URL        : http://<servername>.jax.org:80/strainint/wwv_flow.accept
      PARAMETERS :
      ===========
      P_FLOW_ID:
       130
      P_FLOW_STEP_ID:
       1
      P_INSTANCE:
       2192648522248539
      P_PAGE_SUBMISSION_ID:
       4178748372894033
      P_REQUEST:
       CREATE
      P_ARG_NAMES:
       11575531492595717
       11575928670595718
       11576125314595721
       11576322294595722
       11576527405595722
       11576712936595723
       11577309811595724
       11576910608595723
       11577721685595726
       11577115988595724
       11573904301595707
       11577518806595725
       11574113261595713
       11574921234595715
       11574314190595713
       11575110416595716
       11574500155595714
       11575302176595716
       11574715417595715
       11577924123595726
      P_T01:
      P_ARG_VALUES:
       071B90D8C7B7FDAFAA1638E501544F52
      P_T03:
      P_T04:
      P_T05:
      P_T06:
       %null%
      P_T07:
      P_T08:
      P_T09:
      P_T10:
       %null%
      P_T11:
      P_T12:
      P_T13:
      P_T14:
      P_T15:
       %null%
      P_T16:
      P_T17:
      P_T18:
      P_T19:
       %null%
      P_T20:
       000003
      F01:
       a
      F02:
       Once
      F03:
       Female
      F04:
       Individual Mice
      F05:
      FCS:
       745AFCAE1A306367955C8FCA792EE269
      UNDEFINED:
       03AHJ_VuuC3DyB3T6d-saC7Eszp5QixAWR5kKWi1aR5inbScamnnEfvIJg8J19eVZKkT0JWVqFve0Y76BOMTLzAO_z8NhoTJiS76FzgpfW0mjgC4rqROmE8943Yk3HAbQLMjMkE51R-NACuDrVlqqLVAnumRWo0UKbLg
      P_MD5_CHECKSUM:
      ENVIRONMENT:
      ============
        PLSQL_GATEWAY=WebDb
        GATEWAY_IVERSION=2
        SERVER_SOFTWARE=Oracle-Application-Server-10g/10.1.2.2.0 Oracle-HTTP-Server
        GATEWAY_INTERFACE=CGI/1.1
        SERVER_PORT=80
        SERVER_NAME=<servername>.jax.org
        REQUEST_METHOD=POST
        QUERY_STRING=
        PATH_INFO=/wwv_flow.accept
        SCRIPT_NAME=/strainint
        REMOTE_HOST=
        REMOTE_ADDR=209.222.204.147
        SERVER_PROTOCOL=HTTP/1.1
        REQUEST_PROTOCOL=HTTP
        REMOTE_USER=APEX_PUBLIC_USER
        ORACLE_SSO_USER=
        OSSO_IDLE_TIMEOUT_EXCEEDED=
        OSSO_USER_GUID=
        HTTP_CONTENT_LENGTH=1228
        HTTP_CONTENT_TYPE=application/x-www-form-urlencoded
        HTTP_USER_AGENT=Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; InfoPath.3; .NET4.0E)
        HTTP_HOST=<servername>.jax.org
        HTTP_ACCEPT=application/x-ms-application, image/jpeg, application/xaml+xml, image/gif, image/pjpeg, application/x-ms-xbap, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/x-shockwave-flash, */*
        HTTP_ACCEPT_ENCODING=
        HTTP_ACCEPT_LANGUAGE=en-US
        HTTP_ACCEPT_CHARSET=
        HTTP_COOKIE=jaxFontSize=68.75; __utma=95497475.355517976.1290438979.1290619284.1290619508.10; __utmz=95497475.1290438979.1.1.utmcsr=jax-db1:7777|utmccn=(referral)|utmcmd=referral|utmcct=/pls/jrad02dv/f; __utmb=95497475.17.10.1290619508; __utmc=95497475
        HTTP_IF_MODIFIED_SINCE=
        HTTP_REFERER=http://<servername>.jax.org/strainint/f?p=strainint:1:2192648522248539::::P1_URL_SC:000003
        HTTP_SOAPACTION=
        HTTP_ORACLE_ECID=462602480001,1
        HTTP_ORACLE_CACHE_VERSION=10.1.2
        HTTP_AUTHORIZATION=
        WEB_AUTHENT_PREFIX=
        DAD_NAME=strainint
        DOC_ACCESS_PATH=docs
        DOCUMENT_TABLE=wwv_flow_file_objects$
        PATH_ALIAS=
        REQUEST_CHARSET=AL32UTF8
        REQUEST_IANA_CHARSET=UTF-8
        SCRIPT_PREFIX=
        HTTP_IF_MATCH=
        HTTP_CACHE_CONTROL=
        SOAP_BODY=
        HTTP_X_ORACLE_DEVICE_CLASS=
        HTTP_X_ORACLE_DEVICE_ORIENTATION=
        HTTP_X_ORACLE_DEVICE_MAXDOCSIZE=
        HTTP_X_ORACLE_DEVICE=
        HTTP_X_ORACLE_ORIG_ACCEPT=
        HTTP_X_ORACLE_ORIG_USER_AGENT=
        HTTP_X_ORACLE_USER_LOCALE=
        HTTP_X_ORACLE_USER_NAME=
        HTTP_X_ORACLE_USER_DISPLAYNAME=
        HTTP_X_ORACLE_USER_USERKIND=
        HTTP_X_ORACLE_USER_AUTHKIND=
        HTTP_X_ORACLE_USER_DEVICEID=
        HTTP_X_ORACLE_USER_LOCATION_ADDRESSLINE1=
        HTTP_X_ORACLE_USER_LOCATION_ADDRESSLINE2=
        HTTP_X_ORACLE_USER_LOCATION_ADDRESSLASTLINE=
        HTTP_X_ORACLE_USER_LOCATION_BLOCK=
        HTTP_X_ORACLE_USER_LOCATION_CITY=
        HTTP_X_ORACLE_USER_LOCATION_COMPANYNAME=
        HTTP_X_ORACLE_USER_LOCATION_COUNTY=
        HTTP_X_ORACLE_USER_LOCATION_STATE=
        HTTP_X_ORACLE_USER_LOCATION_POSTALCODE=
        HTTP_X_ORACLE_USER_LOCATION_POSTALCODEEXT=
        HTTP_X_ORACLE_USER_LOCATION_COUNTRY=
        HTTP_X_ORACLE_USER_LOCATION_TYPE=
        HTTP_X_ORACLE_USER_LOCATION_X=
        HTTP_X_ORACLE_USER_LOCATION_Y=
        HTTP_X_ORACLE_SERVICE_HOME_URL=
        HTTP_X_ORACLE_SERVICE_PARENT_URL=
        HTTP_X_ORACLE_HOME_URL=
        HTTP_X_ORACLE_MODULE_CALLBACK_URL=
        HTTP_X_ORACLE_MODULE_CALLBACK_LABEL=
        HTTP_X_ORACLE_CACHE_USER=
        HTTP_X_ORACLE_CACHE_SUBID=
        HTTP_X_ORACLE_CACHE_AUTH=
        HTTP_X_ORACLE_CACHE_DEVICE=
        HTTP_X_ORACLE_CACHE_LANG=
        HTTP_X_ORACLE_CACHE_ENCRYPT=
        HTTP_X_ORACLE_ASSERT_USER=Edited by: pgtaviator on Nov 24, 2010 1:14 PM

    In trying to chase the problems I was having with recaptcha as a non-plugin entity in 3.2, I realized that I had set the region I put the plugin in to condition=never at some point in the past and didn't removed that condition with my efforts today. My apologies, it was a oversight on my part of having abandoned this a while back and completing another project and coming back to this.
    I have it working now. Sorry for the confusion.
    Paul

  • Popup Key LOV, NULL and "Invalid numeric value undefined for column"

    Hello.
    I've created an item based on database column of NUMBER type and set the following properties:
    Display As = Popup Key LOV (Displays description, returns key value)
    List of values definition=select 'display_value' d, 1 r from dual
    Null display value=%
    Null return value=
    Display Null=Yes
    When I select "%" in the LOV and try to apply changes to database I get error:
    ORA-20001: Error in DML: p_rowid=1781, p_alt_rowid=N1, p_rowid2=, p_alt_rowid2=. ORA-20001: Invalid numeric value undefined for column N2
    Error Unable to process row of table TTT.
    If I set Display As = Select List, all works fine. But I need Popup Key LOV.
    Could anybody help me?
    I use Application Express 2.2.1.00.04

    Hi all,
    I did my homework and solved this issue. First I would like to thank Patrick Wolf for the invaluable help he gives out on thread Re: Null value handling in LOVs The code presented here is just a minor edit to his code, but an essential one when dealing with Popup Key LOV items.
    Here's what I did:
    1. Create an Application Process.
    Name: RemoveNulls
    Sequence: 0
    Point: On Submit: After Page Submission - Before Computations and Validations
    Process Text:
    BEGIN
        FOR rItem IN
          ( SELECT ITEM_NAME
              FROM APEX_APPLICATION_PAGE_ITEMS
             WHERE APPLICATION_ID   = TO_NUMBER(:APP_ID)
               AND PAGE_ID          IN (TO_NUMBER(:APP_PAGE_ID), 0)
               AND LOV_DISPLAY_NULL = 'Yes'
               AND LOV_DEFINITION   IS NOT NULL
               AND LOV_NULL_VALUE   IS NULL
        LOOP
            IF (V(rItem.ITEM_NAME) = '%null' || '%' OR V(rItem.ITEM_NAME) = 'undefined')
            THEN
                Apex_Util.set_session_state(rItem.ITEM_NAME, NULL);
            END IF;
        END LOOP;
    END;Error Message: #SQLERRM#Condition: None
    2. You should be able to submit a Popup Key LOV with a NULL value now.
    Once again, THANKS, Patrick! You rock! I'm seriously thinking of trying ApexLib now :)
    Georger

  • Apex Essential application is not working in Apex 4.0

    Hi,
    We recently upgrated from apex 3.2 to apex 4.0. After the upgrade the apex essentials (developed by Patrick Wolf and team) is not working.
    The application can be opened, but the pages look very odd as the icons are not displayed properly. The advisor and power search options can be run, however get the following error.
    " ORA-20555: Unknown dictionary view APEX_APPLICATION_PAGE_DA
    Return to application."
    Can it be only used in 3.x?. In order to run apex 4.0 what we need to do? We already deinstalled and reinstalled the application, but got the same error.
    Advance Thanks,
    Natarajan

    I haven't used 4.0 extensively, but get the impression that all that functionality is now built into 4.0, thus not requiring an external application any longer.

  • How to have cascading lov for a single column in tabular form

    Hi,
    How to have a cascading lov for a single column in tabular form
    ie i have one employee name column
    in tabular form if v pressed add row then one row ll be added
    In my scenario based on first row value
    the second row value to be displayed
    To achieve this what i have to do ..
    Regards,
    Pavan

    READ Cascading select list on tabular form  and
    Oracle APEX 4.0: Cascading LOVs/Select Lists | Inside Oracle APEX by Patrick Wolf BLOG
    helps you,
    Pars.

  • Is there an easy way to generate a site map of an APEX application ?

    Hi.
    Is there an easy way to generate a site map of an APEX application ?
    Thanks.

    Depends on your definition of "easy"...
    Patrick Wolf provided one way to do this a few years ago.

  • Date Field Displaying and DML Operations

    Hi all,
    I have an issue with displaying and updating date columns that I'm hoping someone can assist me with.
    I'm using APEX 3.0.1.
    I have a Form page with a number of fields sourced from one database table that are being populated by an Automatic Row Fetch On Load - After Header.
    The Item P6_MONTHFOR is stored as a Date datatype in the table and displayed on the form using the Date Picker (use Item Format Mask). I have a Format Mask set as 'MON-RR'. I want to ensure that the last day of the month is saved back to the database table so have been trying various calculation techniques to try and achieve this but am experiencing a variety of SQL errors!
    I have tried using LAST_DAY(:P6_MONTHFOR) in the Post Calculation Computation, or as a separate Computation After Submit.
    I have also tried having P6_MONTHFOR as a hidden column and using display Items and then trying Item calculations to then update the value of P6_MONTHFOR column prior to DML operations but to no avail.
    The only DML operations allowed on these rows are DELETE and UPDATE and I'm using an Automatic Row Processing (DML) On Submit - After Computations and Validations process to control these operations.
    Any help or suggestions greatly appreciated :-)
    Kind Regards,
    Gary.

    the function LAST_DAY is a date function, expecting a date as input. Since it is all web, the values of items are as string/varchar2. In order to use date-function, you have to first make it a date with to_date() with the format-mask (DD-MON-RR).
    In my opinion Dates are still tricky, it would be great if ApEx would have a DV() function, next to the V() and NV() functions, It is in ApExLib (of Patrick Wolf)
    Simon

  • How to show a database trigger error message as a notification on a page

    I have a database with database triggers to ensure data integrity.
    If an insert or update does not comply to all the business rules, a database triggers raises an exception. When using Apex this exception is caught in the Error Screen, a separate screen, where the whole error stack is displayed.
    Does anyone know a way to display only the error in RAISE_APPLICATION_ERROR as a notification in the screen from which the transaction was initiated?
    Dik Dral

    Well, having had so little response, i had to figure it out myself ;-)
    Using Patrick Wolff's ideas from ApexLib I 'invented' a solution for my problem, that I would like to contribute to the community. I hope that it will come out a bit nicely formatted:
    Apex: Show Database Error Message in calling form
    The purpose is to show a neat error message in the notification area of the calling form.
    Default Apex show the whole error stack raised by a DB trigger in a separate error page.
    With acknowledgement to Patrick Wolf, I lent parts of his ApexLIB code to create this solution.
    <br./>
    Assumptions
    <ul><li>The error message is raised from a DB trigger using RAISE_APPLICATION_ERROR(-20000,’errormessagetext’).</li>
    <li>The relevant part of the error stack is contained within the strings ‘ORA-20000’ and the next ‘ORA-‘-string, i.e. if the error stack is ‘ORA-20000 Value should not be null ORA-6502 …’, than the relevant string is ‘Value should not be null’ .</li>
    <li>Cookies are enabled on the browser of the user </li>
    </ul>
    Explanation
    The solution relies heavily on the use of Javascript. On the template of the error page Javascript is added to identify the error stack and to extract the relevant error message. This message is written to a cookie, and then the control is passed back to the calling page (equal to pushing the Back button).
    In the calling page a Javascript onLoad process is added. This process determines whether an error message has been written to a cookie. If so the error message is formatted as an error and written to the notification area.
    Implementation
    The solution redefines two template pages, the two level tab (default page template) and the one level tab (error page template).
    Javascript is added to implement the solution. This Javascript is contained in a small library errorHandling.js:
    <pre>
    var vIndicator = "ApexErrorStack=";
    function writeMessage(vMessage)
    {       document.cookie = vIndicator+vMessage+';';
    function readMessage()
    { var vCookieList = document.cookie;
    var vErrorStack = null;
    var vStart = null;
    var vEnd = null;
    var vPos = null;
    vPos = vCookieList.indexOf(vIndicator);
    // No cookie found?
    if (vPos == -1) return("empty");
    vStart = vPos + vIndicator.length;
    vEnd = vCookieList.indexOf(";", vStart);
    if (vEnd == -1) vEnd = vCookieList.length;
    vErrorStack = vCookieList.substring(vStart, vEnd);
    vErrorStack = decodeURIComponent(vErrorStack);
    // remove the cookie
    document.cookie = vIndicator+"; max-age=0";
    return(vErrorStack);
    function getElementsByClass2(searchClass,node,tag)
    var classElements = new Array();
    if ( node == null )
    node = document;
    if ( tag == null )
    tag = '*';
    var els = node.getElementsByTagName(tag);
    var elsLen = els.length;
    var pattern = newRegExp('(^|\\s)'+searchClass+'(\\s|$)');
    for (i = 0, j = 0; i < elsLen; i++) {
    if ( pattern.test(els.className) ) {
    classElements[j] = els[i];
    j++;
    return classElements;
    function processErrorText()
    var errorElements = new Array();
    errorElements = getElementsByClass2("ErrorPageMessage",document,"div");
    if (errorElements.length > 0 )
    { errorText = errorElements[0].innerHTML;
    errorText = errorText.substr(errorText.indexOf("ORA-20000")+ 11);
    errorText = errorText.substr(0,errorText.indexOf("ORA")-1);
    // errorElements[0].innerHTML = errorText;
    writeMessage(errorText);
    function show_message()
    { var vCookieList = document.cookie;
    var vErrorStack = null;
    var vErrorName = null;
    var vErrorMessage = null;
    var vStart = null;
    var vEnd = null;
    var vPos = null;
    // get errorStack
    vErrorStack = readMessage();
    if (vErrorStack == -1) return;
    // search for our message section (eg. t7Messages)
    var notificationArea = document.getElementById("notification");
    if (notificationArea != null)
    { notificationArea.innerHTML = '<div class="t12notification">1 error has occurred<ul class="htmldbUlErr"><li>' + vErrorStack + '</li></ul>'; }
    else
    { alert(vErrorStack); }
    </pre>
    This code is loaded as a static file in Application Express (no application associated).
    In both templates a reference to this code is added in the Definition Header section:
    <pre>
    <script src="#WORKSPACE_IMAGES#errorHandling.js" type="text/javascript"></script>
    </pre>
    This library is called from the two level tab to show the error message (if any) in het onLoad event of the body tag.
    <body onLoad="javascript:show_message();">#FORM_OPEN#
    This code checks whether a message has been written to a cookie and if found displays the message in the notification area.
    In the error template page the Error section has the content:
    <script language="javascript">
    processErrorText();
    window.history.go(-1);
    </script>
    Back
    The call to processErrorText() looks for the error message, extracts the relevant part of it (between ‘ORA-20000’ and the next ‘ORA-‘), writes it to a cookie and returns to the previous screen.
    The link to the previous page is added should an error in the Javascript occur. It provides the user with a path back to the application.
    With these actions taken, the error messages issued from triggers are shown in the notification area of the form the user has entered his data in.
    The need for database driven messaging
    In some cases the need exists to process error messages in the database before presenting them to the user. This is the case, when the triggers return message codes, associated to error messages in a message table.
    This can be done by using a special Error Message Processing page in Apex.
    The error message page extracts the error message, redirecting to the Error Message Processing page with the error message as a parameter. In the EMP page a PL/SQL function can be called with the message as a parameter. This function returns the right message, which is written to a cookie using dynamically generated Javascript from PL/SQL. Than the contol is given back to the calling form.
    The redirect is implemented by location.replace, so that the error message page does not exist within the browsing history. The normal history(-1) will return to the calling page.
    Implementation of database driven messaging
    The solution redefines two template pages, the two level tab (default page template) and the one level tab (error page template).
    Javascript is added to implement the solution. This Javascript is contained in a small library errorHandling.js already listed in a previous paragraph.
    In both templates a reference to this code is added in the Definition Header section:
    <script src="#WORKSPACE_IMAGES#errorHandling.js" type="text/javascript"></script>
    This library is called from the two level tab to show the error message (if any) in het onLoad event of the body tag.
    <body onLoad="javascript:show_message();">#FORM_OPEN#
    This code checks whether a message has been written to a cookie and if found displays the message in the notification area.
    In the error template page the Error section has the content:
    <script language="Javascript">
    var errorText = null;
    function redirect2oracle()
    { window.location.replace("f?p=&APP_ID:500:&APP_SESSION.::::P500_MESSAGE:"+errorText); }
    function getError()
    { errorText = processErrorText(); }
    getError();
    redirect2oracle();
    </script>
    Go to Error Message Porcessing Page
    Back to form
    The call to processErrorText() looks for the error message, extracts the relevant part of it (between ‘ORA-20000’ and the next ‘ORA-‘), writes it to a cookie.
    Then the EPM-page (500) is called with the extracted message as parameter.
    The link to the EPM page and the previous page is added should an error in the Javascript occur. It provides the user with a path back to the application.
    We need to create an Error Message Porcessing Page.
    Create a new page 500 with a empty HTML-region “Parameters”
    Create an text-area P500_MESSAGE in this region
    Create a PL/SQL region “Process Messages” with source:
    convert_message(:P500_MESSAGE);
    Create a PL/SQL procedure convert_message like this example, that reads messages from a message table. If not found, the actual input message is returned.
    CREATE OR REPLACE procedure convert_message(i_message in varchar2) is
    v_id number := null;
    v_message varchar2(4000) := null;
    function get_message (i_message in varchar2) return varchar2 is
    v_return varchar2(4000) := null;
    begin
    select msg_text into v_return
    from messages
    where msg_code = upper(i_message);
    return(v_return);
    exception
    when no_data_found then
    return(i_message);
    end;
    begin
    v_message := get_message(i_message);
    // write the message for logging/debugging
    htp.p('Boodschap='||v_message);
    // write cookie and redirect to calling page
    htp.p('<script language="Javascript">');
    htp.p('document.cookie="ApexErrorStack='||v_message||';";');
    htp.p('window.history.go(-1);');
    htp.p('</script>');
    // enter return link just in case
    htp.p('Ga terug');
    end;
    Note: The way the message is converted is just an example
    With these actions taken, the error messages issued from triggers are shown in the notification area of the form the user has entered his data in.
    Message was edited by:
    dickdral
    null

  • Is null validation not working correctly

    I have an application in which I have created a data entry page. We are using apex version 3.0.1.00.08.
    I have an item whose source is a database column which has a select list associated with it, as I want to show the user that they have not yet picked anything from the select list i have the lov properties set as follows:
    display null = Yes
    null display value = Please select
    I also have a page processing validation to check that the user has entered a value. the code for this validation is as follows:
    if :P1_DATA_ITEM is null then
    return 'This value for this Item must be selected before this record can be saved to the database';
    else
    return null;
    end if;
    However on the save button if but the user not selected a value for P1_DATA_ITEM so it is still showing -- please select -- the validation does not fail and lets the user save the record. This is not the behaviour that I want as I am trying to trap the fact that the user has not selected a value.
    This seems to indicate that Apex thinks P1_DATA_ITEM is not null so i checked session state for this item and it is showing %null%.
    How can I get a select list to indicate that the user has not actually selected a value but also to validate correctly, how do I deal with items when their session state is %null%.
    The only way round this issue that I have found is to use a radio button because it is obvious that the user has not yet selected a value but I would prefer to use a select list as we will need to do the same thing for other fields where a radio button would be impractical. I also need to indicate to the user that they still have to pick a value for this field and if you do not set the proprerty display null to Yes then it looks to the user as though they have selected an item becuse the first value in the select list appears.
    Can anyone advise on this.
    Regards
    Kay

    Hi Kay...
    Patrick wolf came up with this excellent piece of code here on this forum (I'd reference it but I can't find it at the moment.
    Instead of checking for the %null% state of each select list item on every page you can use this application process to do the job for you...
    Create an Application process
    -) Name: APP_Remove_NULLS
    -) Sequence: 0 (should be a number before any of your page level processes)
    -) On submit: After Page Submission - Before Computations and Validations
    BEGIN
        FOR rItem IN
          ( SELECT ITEM_NAME
              FROM APEX_APPLICATION_PAGE_ITEMS
             WHERE APPLICATION_ID   = TO_NUMBER(:APP_ID)
               AND PAGE_ID          = TO_NUMBER(:APP_PAGE_ID)
               AND LOV_DISPLAY_NULL = 'Yes'
               AND LOV_DEFINITION   IS NOT NULL
               AND LOV_NULL_VALUE   IS NULL
        LOOP
            IF V(rItem.ITEM_NAME) = '%null'||'%'
            THEN
                Apex_Util.set_session_state(rItem.ITEM_NAME, NULL);
            END IF;
        END LOOP;
    /* if you have select lists in your page zero items, remove this comment
        FOR rItem IN
          ( SELECT ITEM_NAME
              FROM APEX_APPLICATION_PAGE_ITEMS
             WHERE APPLICATION_ID   = TO_NUMBER(:APP_ID)
               AND PAGE_ID          = 0
               AND LOV_DISPLAY_NULL = 'Yes'
               AND LOV_DEFINITION   IS NOT NULL
               AND LOV_NULL_VALUE   IS NULL
        LOOP
            IF V(rItem.ITEM_NAME) = '%null'||'%'
            THEN
                Apex_Util.set_session_state(rItem.ITEM_NAME, NULL);
            END IF;
        END LOOP;
    END;This is the first thing I do when I create a new application... It removes that whole '%null'||'%' can of worms in one go...
    Gus..

  • How to change report query dynamically in Oracle APEX?

    Hi,
    I want to dynamically change the where condition in APEX report query. Can anyone help me solve my this problem?
    (Just want to change the query which we change in Oracle Reports using lexical parameter to change &Where, &Order by etc. dynamically!!)
    Thanks, Praful

    Hi
    I've been using flexible queries in APEX for a few years now, and your question just added a whole new dimension to the flexible and powerful nature or writing reports in APEX.
    While APEX Interactive reporting has almost completely removed the need the equivalent of Lexicals in Oracle Reports, I thought it might be fun to try and use lexicals in an APEX report.
    Before we start I should summarise the powerful capability of APEX reporting to have oprtional parameters (lots and lots of them if this is needed).
    For each parameter, you simply add a page item which will hold the value of the parameter.
    The item/parameter can be populated by typing in the value, defining an LOV, using a date-picker etc.
    To make the parameter optional simply use an OR in the where clause.
    So for a apge item P200_PARAM1.....include
    WHERE (:P200_PARAM1 IS NULL
    OR COLUMN1 = :P200_PARAM1)
    This way you can either leave the page item null or type in / select a value from a LOV.
    There is a small quirk in APEX LOV's which sometimes returns a value of '%' or '%null%' - depending on the version - when no value is selected.
    See Patrick Wolf's solution for this at Re: Null value handling in LOVs
    I include this Application Process in all my APEX applications ;)
    Now let's look at using the equivalent of Oracle Reports Lexicals......
    First-off - this is based on the APEX SQL report - NOT Interactive Report.
    It relies on the fact that you can let the query be parsed only at runtime.
    1. Define an SQL report entering the 'core' of your query.
    With a query like SELECT ENAME, JOB FROM EMP
    Select 'Generic Columns' option in the 'Column Headings' section
    Finish the report creation
    2. Define a page item - say P200_LEXICAL - type text on the page
    3. Edit the report and update the SQL query to include your lexical page item
    SELECT ENAME, JOB FROM EMP &P200_LEXICAL. (REMEMBER THE '.' AT THE END)
    Ensure that the option "Use Generic Column Names (parse query at runtime only)" is selected at the bottom of the query
    4. Add a button to the page -using 'Create a button displayed among this region's items' the will submit the page.
    5. Run the page - you will see all the employee names and job desdriptions
    6. Enter a where clause into the 'Lexical' textbox - say "WHERE ENAME LIKE 'K%'" and click the 'Go' button
    Voila! your where clause is magically applied.
    Try any variant you like adding an ORDER BY clause etc...... this is FUN!
    7. Clear the value of the LEXICAL and click go.
    Edit the report and move the &P200_LEXICAL. into the selected columns (or add another one)
    SELECT ENAME, JOB &P200_LEXICAL. FROM EMP
    8. Run the page
    Enter ",SAL" in the textbox and "Go"
    We can add as many columns as we like (subject to the "Maximum number of generic report columns:" set below the SQL query in the report edit section)
    Now because we have all the flexibility in APEX of setting page items using SQL or PLSQL you can set the value of the lexical programatically, or just pre-set a few values in an LOV - the options are limitless.
    While I've never had the need to use lexicals - you can see that APEX provides the most Flexible Lexicals in town.
    Eat your heart out "Oracle Reports"!!!
    Have fun
    Mike

  • Can't do online banking. Get error message. "The requested URL /Summary.cgi was not found on this server. Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

    I can't do online banking. When I try to open the page I get error "The requested URL /Summary.cgi was not found on this server.
    Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

    Hi,
    These blog posts might help debug problem
    Oracle APEX: Got a 404 Not Found? | Inside Oracle APEX by Patrick Wolf
    daust_de :: Oracle XE / APEX: Troubleshooting the 404-not found error on XE
    Regards,
    Jari

  • How to know whether any item value got changed

    How to know in Apex whether any form item got changed. That will help me to know when the user will be pressing the "Apply Changes" button and I will popuplate the "User Modifed" and "Date Modifed" column values in the table. For now, I dont want to write database triggers, but to implement it at application level.

    Hi Deb
    For a really good explanation of the naming /numbering of tabular form items see Patrick Wolf's blog on the matter.
    http://www.inside-oracle-apex.com/which-tabular-form-column-is-mapped-to-which-apex_applicationg_fxx-array/
    He also gives a simple example of using check-boxes in tabular forms here
    http://www.inside-oracle-apex.com/checkboxes-in-tabular-forms-the-easy-way/
    You will notice in his example, that the apex_application.g_f40 is specifically named as 40 - a high number assuming that you don't have more than 39 editable columns in you tabular form - shown in the name="f40" code.
    <input type="checkbox" #ADMIN_USER_CHECKBOX# value="#ROWNUM#" name="f40" id="f40_#ROWNUM#"/>#ADMIN_USER_CHECKBOX#
    In essence the columns are numbered (only the editable ones) in the order in which they appear in the select statement - so the first editable column will be f(01), next f(02) etc - except where the column is specifically named - in this case f(40).
    I had a situation where I wanted to programatically stamp the user's name into a column depending on whether the user checked a check-box in each row.
    But if the column is editable and visible, then the user is free to type into this cell - this I wanted to avoid.
    Something that took me a while to work out is that you can hide an editable column - so it can updated by your procedure code - not by the user!
    The way to solve this is to have the sql statement select the relevant column twice - the first one is the editable one and hidden, and the second copy is a normal report column - displayed but not editable.
    I used Patrick's example in the link above to set up my tabular form with the first column as a check-box.
    The user then marks the desired rows by clicking in the check-box and submits / saves.
    The procedure then detects which rows have been checked - updates the editable (but hidden) database column, and then re-displays the result - with the second copy of the same column now showing the updated value!
    I hope this helps.
    Look at Patrick's other postings - they are so helpful.
    Mike

  • Open pdf in popup browser window

    Hello
    I want to show a pdf file which is stored in a blob column in the database in a popup browser window.
    I'm using apex 4.1 (soon 4.2) ans an 11gR2 database.
    I searched the OTN forum and found a lot of threads about this issue but I do not see a solution that works fine for me.
    Most inspiration from this post:
    Show PDF ....
    There is an example application from Kumar:
    http://apex.oracle.com/pls/apex/f?p=52018
    worspace: kumar2003
    username: test_user
    password: test
    application: 52018
    Test1 is the solution I want to create.
    I tried :
    Content-Disposition:  inline;and that works almost fine. Only the pdf is not in a popup browser window.
    Patrick Wolf suggests:
    <a href="your_download_link" target="_blank">PDF</a>But I do not exactly know what he means.
    Any help would be appreciated.
    Regards Erik

    Hi,
    I hope I understood your question correctly, if so my suggestion may be helpful. Otherwise I think it's nearly the same what paul writes, I only made clear my proposal in a website for you, first a photo:
    and here is the link: http://www.goldschmiede-blumberg.de/pdf/adob_pdf.php.
    Note 1: "Ausgabe 9" und "ein Mausklick hier genügt" are links!!
    Note 2: " Um pdf-Dateien ...." Means: To read pdf files, you need the free Adobe Reader. The current version you can download from the Adobe website.
    Look at it's source code.
    Viel Erfolg
    Hans-G.

  • Substitution in Custom XML section of a chart

    Hello,
    I am trying to do a substitution inside of "Custom XML" section of a "Resource Gantt" chart using &P5_GANTT_XML. (dot at the end - thanks fac586)
    The substitution doesn't work! In the "Show XML" I can see null instead of expected value.
    Seems this substitution is working in this demo http://apex.oracle.com/pls/apex/f?p=36648:60:3572101667083478::NO:::
    Any idea?
    Regards,
    Gabriel
    DB: 11.2.0.1.0 EE
    Apex: 4.0.2
    Server: Solaris 10 Sparc
    Client: XP SP3
    Browser: Firefox 3.6.13
    Flash player: updated to latest version
    Edited by: gabosu on Jan 5, 2011 11:07 AM
    Edited by: gabosu on Jan 5, 2011 11:10 AM

    In the thread
    Re: Page item value in Flash chart XML
    dated NOV-2007
    Patrick Wolf wrote:
    there seems to be something strange going on with the substitution of page items in the Custom XML. I already noticed that several weeks ago, but didn't pay much attention to the problem.
    Have a look at the following application at http://apex.oracle.com/pls/otn/f?p=15535:5
    username: demo
    pwd: patricks_demo_workspace
    It has a page item P5_TEST with a static assignment of "this is a x label". Everywhere where I reference it with &P5_TEST. or :P5_TEST during the rendering of the page the correct value is substituted as you can see on the example page.
    Only the flash charts seems to use a NULL value! I have done a
    ...x_axis name="before-&P5_TEST.-after" smart="yes"... in the Custom XML.
    Why is there this different behavior of substitution? Or do I miss something?
    I made the same behavior - the substitution is triggering somehow but the result is NULL.
    Example:
    into Custom XML
    <test>start-&P5_GANTT_XML.-end</test>
    is returning
    <test>start--end</test>
    and
    in the same time &P5_GANTT_XML. is working fine into the title of the region.
    Edited by: gabosu on Jan 5, 2011 12:21 PM

  • Date Picker BUG on APEX 4.2.1

    Hi all could you please open a ticket for the following bug.
    Reproducing the bug very simple.
    Apex specification :
    version 4.2.1.00.08
    I'm not using HTML 5 template but the classic "Blue and Tan" one.
    1) Create a page with date picker with mask (DD-MON-YYY HH24.MI).
    2) set as default value the SYSDATE using the PLSQL expression (not specifying the mask to_char()).
    3) Try to use it and you will see that the year shown is not the correct one but is something like 1911.
    I fixed using to_char(SYSDATE,'DD-MON-YYY HH24.MI') in the PLSQL expression.

    Hi Zere,
    one very important thing to remember when dealing with session state (the value of a page item) is that everything is stored as string.
    If you specify SYSDATE as your default expression, then the Oracle database will evaluate that as date data type, but as soon as it's stored in session state, the database will do an implicit data type conversion using the default format mask specified for your database session.
    That's why it works when you do the TO_CHAR with the explicit format mask.
    Regards
    Patrick
    Member of the APEX development team
    My Blog: http://www.inside-oracle-apex.com
    APEX Plug-Ins: http://apex.oracle.com/plugins
    Twitter: http://www.twitter.com/patrickwolf
    Edited by: Patrick Wolf on Apr 10, 2013 3:37 PM

Maybe you are looking for

  • How to increase AFP data transfer speed?

    When I connect to our server from a WAN source outside of our facility the file data transfer rate is extremely slow. We just upgraded to a 10Mps fiber service and that has dematically increased our website data tranfer speed. I would like to find a

  • Windows 2008 Server and HP Color LaserJet 2605dn Driver Issue when Sharing Printer

    I have a HP Color LaserJet 2605dn printer that I need to setup on a Windows 2008 server.  I need the server to act as a Print server, but I have been unable to get any drivers to load other than the 64 Bit Universal drivers.  Because most of the comp

  • DVD RAM Drive issue

    We have a macbook pro with 2 gig of RAM and osx tiger 10.4.8. We have a DVD RAM drive due to the nature of our work. This drive always seemed to take longer to sin up thn other drives but I just assumed this was o.k Now the drive simply spits all DVD

  • Purchase requisition not generated

    Hi Gurus, Purchase requisition not generated at the time of sales order for Item category tab. Can you please let me know the posible reason. Thanks in advance...

  • How to show view based on condition

    Hi, I have a scenario with login screen with a submit button and two views(success and error). Now I want to show a)a successful view if user enters a correct login name and password(which will be validated with static values in action method of subm