Application Level Function for Conditional Display

I need to hide a field on Print Preview if it is null. I currently have the following PL/SQL Expression Condition:
:P305_DEPT IS NOT NULL AND v('PRINTER_FRIENDLY') <> 'YES'
It works great; now I need to do this for a lot more fields within my application. Is there a way to call a PL/SQL process defined in HTML DB, passing it the current item value, or some other way to save myself some typing?
I've tried various combinations of shortcuts, substitution strings, application processes, etc. and can't seem to get the right combination.
I'm hoping you have a cool solution, or some other ideas I can try out.
Thanks!
Chaunaci

Hi Raj,
All of this came up because we have several data items displayed above each report page, which allow the user to enter filter criteria. When the page is displayed in Print Friendly mode, the Select Lists display as blanks when null, but Text Boxes display as [] when null.
Our QAs have asked us to make all of the filter fields consistent in appearance in Print Friendly mode. The work-around solution is to hide the filter fields that are null when in Print Friendly mode. Therefore, we came up with the following PL/SQL Expression to use in the Conditional Display:
:P305_DEPT IS NOT NULL AND v('PRINTER_FRIENDLY') <> 'YES'
Because I will need to add the above conditional statement to many items, I was hoping to create and call an HTML DB application-level process and pass the current item value in, so my conditional display logic would look something like...
HIDE_NULL_ON_PRINT(:P305_DEPT).
When I was doing some additional testing last night, I realized my boolean logic needed to be tweaked, and it would be nice to tweak it in just one place, rather than on every field's conditional display.
I currently have it working by putting the IS NOT NULL AND v('PRINTER_FRIENDLY') <> 'YES' into an application substitution string, so my conditional logic shows as:
:P305_DEPT &HIDE_NULL_FOR_PRINT.
In trying to determine if this was the best solution, I need answers to the following issues:
1. Is there a way to generically reference the current item in the conditional display logic? I currently type in the specific item name (ex: :P305_DEPT), but it would be nice if instead I could just say &CURRENT_ITEM_NAME. (or something similar).
2. Can I create an application-level process, pass a parameter into it (the current item), and have it return a value that can be evaluated by my conditional logic display?
Thanks so much for your quick responses to this and all my previous posts. It is wonderful to be able to post a problem at the end of the day, and come in to a solution in the morning!
Chaunaci

Similar Messages

  • Authorization level check for Condition records.

    Hi,
    Hi Gurus,
    Pls help me out in the the following scenario.
    I want to activate Authorization level check for Condition records.
    For example, Product price PR00 is being entered by first level.
    After verification done by second level only, that condition record to be used for sales order processing.
    I have gone through Process status & Release Status. But once it is Blocked  i am not able to release it...
    Rgds,
    Amol

    Amol,
    Please confirm transaction code you are using in this scenario to release. I can help with this, just a little more detail.
    Thanks,
    Jay

  • Use of basic SQL functions in conditional display of an item

    I'm trying to use the following to conditionally display an item.
    Condition Type is set to: "Value of Item in Expression 1 = Expression 2"
    Expression 1: "sign ( instr ( :column_name, '1*' ) )"
    Expression 2: "1"
    The :column_name column contains an asterisk delimited list of numbers. I wish to hide or show an item based on whether a specific number is in the list. When I run the page, the item never shows up. For testing purposes, I am using HTP.P to display not only the entire value of :column_name, but also the resulting value from the "sign(instr(... ))" code. The results of the HTP.P debugging show that the expression does indeed return a value of 1, but the item is still not displaying.
    Any thoughts? I'm relatively new to HTML DB, so there may be some obvious thing I am missing.

    Try setting the Condition Type to "PL/SQL Expression" and use:
    sign ( instr ( :column_name, '1*' ) ) = 1
    The express must evaluate to TRUE for the item to display. See the "Conditions Available in Oracle HTML DB" section in the Oracle HTML DB User's Guide.

  • Change Default Application level setting for checkbox value from "On"/"Off" to 1/0

    Hi,
      I am creating livecycle designer forms. In that the checkboxes take a default value of "On'/"Off" and I have to change it to 1 and 0 in all the boxes on layout checkbox property.
    In livecycle i have to change it in Object-Binding tab.
      Is there an application level setting where I can set the default to 1 and 0 instead of "on/"off" at the app level itself? this way every new form will have 0 and 1 instead of off/on
    I export the form data to XML and push it to database and it needs 1 and 0.
    I need the app setting for both Adobe Acrobat 9 Extended Pro
    Please help

    It is 1/0 by default .....if you drag a checkbox from the object library onto the canvas and you are getting on/off as your default, then you have modified th eobject. You can set the object the way you want (anf property not just binding) and then you can drag the object back onto the Library palette. This will ask you to name it and if you choose the same name it will overwrite the one that is in the library.
    Paul

  • Aplication Vs. Page level items for application process

    Hi,
    I have many application processes in my applications, many of them take parameters.
    Right now I am passing parameters using page level temporary items. This is causing each page to have many items that are only used for calling the application process.
    Is it better to use application level items for this purpose?
    any pros and cons for each of these?
    ~Ketan

    Arie,
    Are you saying that the condition only apply to rendering the item, but the APEX engine will still consider such an item a valid “internal” variable?
    Yes. The absence of a condition on a page item or a condition that evaluates to true simply allows it to be rendered on the page. The existence of the item in the page definition allows it to hold session state.
    We're planning to introduce a non-displaying page item type just for this purpose, sort of a scratchpad variable with no display properties, like an applicaition item but defined on a page.
    Scott

  • Conditional display in a SQL-Report/Report Region

    Hi,
    here I have an example for "Conditional display in a SQL-Report/Report Region". I figured it out in Firefox 3.6.2 using Firebug as development tool on Apex 3.2.1.00.12.
    First you have to put the following javascript code in the Page HTML-Header:
    <script type="text/javascript">
    <!--
    // SOURCE
    // W:\oracle\PRJ DWLS\javascript.07.js
    // Beispiel Funktion zur bedingten Formatierung einer Tabellenzelle.
    // Help (Substitution Strings):
    // http://htmldb.oracle.com/pls/otn/wwv_flow_help.show_help?p_lang=de&p_session=2412201185523196&p_flow_id=4003&p_step_id=420,4003
    // HTML Expression:
    // <script>ex_conditional_td('R094260001010', #ROWNUM#, #COLNUM#-1);</script>#DFT_COND1#
    function ex_conditional_td
    ( p_id
    , p_rownum
    , p_cellnum
      var l_td;
      l_td = vd_getColumn(p_id, p_rownum, p_cellnum);
      // hier die Bedingung definieren
      if (true) {
        l_td.style.color = '#808080';
    }  // -- eof ex_conditional_td -- //
    // Beispiel Funktion zum Abstellen der onMouse Funktionalität der Tabellenzeile
    // HTML Expression:
    // <script>ex_conditional_tr('R094260001010', #ROWNUM#);</script>#DFT_ID#"
    function ex_conditional_tr
    ( p_id
    , p_rownum
      var l_tr;    // TABLE.TR
      var l_td;    // TABLE.TR.TD
      if (true) {
        l_tr = vd_getRow(p_id, p_rownum);
        l_tr.onmouseover = null;
        l_tr.onmouseout  = null;
        for (var i=0; i<l_tr.cells.length; i++) {
          l_td = l_tr.cells;
    l_td.style.backgroundColor = '#DDDDDD';
    } // -- eof ex_conditional_tr() -- //
    var g_DEBUG = false;
    var g_TBODY = null;
    // Liefert das Body-Element der Tabelle mit der ID <p_id>.
    // Parameter
    // p_id - die Id der HTML-Tabelle
    // Return
    // das Body-Element oder NULL, wenn die Zeile nicht gefunden wurde
    function vd_getBody
    ( p_id
    if (g_TBODY == null) {
    var l_table = null;
    l_table = document.getElementById( p_id );
    if (l_table == null) {
    l_table = document.getElementByName( p_id );
    if (l_table != null) {
    if (vd_debug()) {
    alert("Tabelle gefunden, " + l_table.nodeName);
    g_TBODY = vd_search( l_table, 'TD', 't10data', 'TBODY');
    return g_TBODY;
    } // -- eof vd_getBody() -- //
    // Liefert die Zeile <p_rownum> der HTML-Tabelle mit der Id <p_id>.
    // Parameter
    // p_id - die Id der HTML-Tabelle
    // p_rownum - die Zeilennummer
    // Return
    // die Zeile oder NULL, wenn die Zeile nicht gefunden wurde
    function vd_getRow
    ( p_id
    , p_rownum
    var l_body = vd_getBody(p_id);
    if ( l_body != null
    && l_body.nodeName == 'TBODY'
    && l_body.children[p_rownum].nodeName == 'TR') {
    return l_body.children[p_rownum];
    else {
    return null;
    } // -- eof vd_getRow() -- //
    // Liefert die Spalte <p_column> der Zeile <p_rownum> der HTML-Tabelle mit der
    // Id <p_id>.
    // Parameter
    // p_id - die Id der HTML-Tabelle
    // p_rownum - die Zeilennummer
    // p_column - der Index der Spalte / Zelle
    // Return
    // die Zelle oder NULL, wenn die Zelle nicht gefunden wurde
    function vd_getColumn
    ( p_id
    , p_rownum
    , p_column
    var l_tr = vd_getRow(p_id, p_rownum);
    if ( l_tr != null
    && l_tr.nodeName == 'TR'
    && l_tr.children.length >= p_column
    && l_tr.children[p_column].nodeName == 'TD') {
    return l_tr.children[p_column];
    else {
    return null;
    } // -- eof vd_getColumn() -- //
    // Rekursives Suchen nach einem Node.
    // Zweck: Das bedingte Formatieren einer Tabellenzelle in einem Apex Standard
    // SQL-Report.
    // Diese Funktion durchsucht rekursiv, ab einem Ausgangsknoten <p_node>, alle
    // darunter befindlichen Elemente, ob in dem Element <p_seachIn> sich die
    // Klasse <p_class> befindet.
    // Bei Standard-Reports ist die Reportzelle (TD) mit der Klasse
    // "t10data" formatiert.
    // Zunächst muss dazu die Tabellenzelle (TD) selbst, die übergeordnete
    // Tabellenzeile (TR), der Tabellenbody (TBODY) oder die Tabelle (TABLE)
    // selbst ermittelt werden.
    // Der Beispielaufruf:
    // var l_body;
    // var l_node = document.getElementById( 'R112233' );
    // l_body = search( l_node, 'TD', 't10data', 'TBODY');
    // durchsucht also das mit der Id "R112233" versehene Element [der Report, für
    // den in Apex eine statischen ID vergeben werden musste] rekursiv, bis er
    // die [erste] Tabellenzelle "TD" findet, die als Klasse "t10data"
    // definiert hat. Für diese ermittelt er dann das übergeordnete TBODY-Element.
    // Parameter
    // p_node - das Ausgangselement
    // p_searchIn - der Knotenname, der durchsucht werden soll
    // [node.nodeName == p_searchIn]
    // p_class - der Name der CSS Klasse
    // [node.classList[<index>] == p_class
    // p_parentName - der Name [node.parentNode.nodeName == p_parentName]
    // des Elements, das zurückgeliefert werden soll. Wird als
    // p_parentName der Suchname p_searchIn angegeben, wird
    // das Element selbst zurückgegeben.
    // Return
    // das per p_parentName gesuchte Element (TD, TR, TBODY, TABLE)
    function vd_search
    ( p_node
    , p_searchIn
    , p_class
    , p_parentName
    var LN = "vd_search";
    var l_element = null;
    // DEBUG
    if (vd_debug()) {
    alert(LN + ":" + "Untersuche " + p_node.nodeName + ", id=" + p_node.id);
    // 1) der aktuelle Knoten ist der, der durchsucht werden soll
    if (p_node.nodeName == p_searchIn) {
    if (p_node.classList.length > 0) {
    for(var c=0; c<p_node.classList.length; c++) {
    if (p_node.classList[c] == p_class) {
    // Parent Node dynmisch suchen
    l_node = p_node;
    if (l_node.nodeName == p_parentName) {
    return l_node;
    while(l_node != null && l_node.parentNode != null) {
    if (l_node.parentNode.nodeName == p_parentName) {
    return l_node.parentNode;
    else {
    l_node = l_node.parentNode;
    // 2) wenn nicht 1) oder nicht in 1) gefunden, dann in den Kindelementen
    // weitersuchen
    if (p_node.children.length > 0) {
    var i = 0;
    while (i<p_node.children.length && l_element==null) {
    l_element = vd_search( p_node.children[i], p_searchIn, p_class, p_parentName);
    i++;
    return l_element;
    } // -- eof vd_search() -- //
    // Gibt an, ob Debug ein- (true) oder ausgeschaltet (false) ist.
    // Return
    // true - debug ist eingeschaltet
    // false - debug ist ausgeschaltet
    function vd_debug()
    return g_DEBUG;
    -->
    </script>
    Maybe you have to modify the "vd_getBody" function. I'm searching the table cell with having the class "t10data". When you use another theme, there's maybe another class used.
    Second is, that you set an static id for your report region. I prefer this structure:
    R<app-id><page-id><seq> (Raaaaappppsss) e.g. R094260001010.
    First example is to turn off the onMouse-Effect. Maybe on the first or last column definition you put this code in the "HTML-Expression" area:
    <script>ex_conditional_tr('R094260001010', #ROWNUM#);</script>#ID#This will call the example function ex_conditional_tr with the parameter
    a) the region id
    b) the rownum (as oracle always starts with 1 this is the first data row [rownum=0 is the table header row])
    Second example is the conditional formatting of a table cell. Put this in the HML-Expression area:
    <script>ex_conditional_td('R094260001010', #ROWNUM#, #COLNUM#-1);</script>#ENAME#This will call the example function ex_conditional_tr with the parameter
    a) the region id
    b) the rownum
    c) the cellnum (here we have to subtract 1 to get the "real" cell index)
    The "ex_conditional" functions are just a representation of how to get the row or cell node.
    Hope this help a bit.
    Tom

    I would use a CASE statement in the select....
    each CASE would be an img src tag for a different button if the button is an image.
    does that make sense? I can include an example if you would like...

  • Adding pl/sql expression to application level item

    I would like to have an item shared by all pages within my application. My understanding is that I can define an application-level item for this.
    I know that for page-level items I can pool a value from the database by putting a pl/sql function into the item's "source value or expression" field and by setting the source type to "pl/sql expression or function".
    But I cannot do that for an application-level item. In fact, when I create my application-level item, the properties screen of it has pretty much nothing available to configure. It only has Name, Security, Build Option and Comments.
    Please, advise on how I can pool a value from the database for an application-level item.
    thanks
    Boris

    Boris,
    Application-level items are items that do not get rendered in HTML. They are for keeping named values in session state only and are available for use throughout the application. However, all page items are available for use throughout the application.
    What do you mean by "I would like to have an item shared by all pages within my application. "? If you want an item that gets rendered on every page, create a page 0 and put regions/items on that page.
    I don't know what you mean by "pool a value from the database".
    Scott

  • Conditional display based on row count

    I have a report region with sql query (PL/SQL function body returning sql query). In this region i have text item above the report. I would like to have a condition on this item that it should only show if there exists records in the report (row count > 0).
    How can this be done?
    Best regards
    Erik

    There are many options available for conditional display. You can use this one here:
    http://apex.oracle.com/pls/otn/f?p=31517:7
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://apex.oracle.com/pls/otn/f?p=31517:1
    http://www.amazon.de/Oracle-APEX-XE-Praxis/dp/3826655494
    -------------------------------------------------------------------

  • Conditional display of post element text.

    Hello,
    I wanted to know if it was possible to display the
    post element text for a text item conditionally.
    Thanks,
    shilpa.

    Hi Shilpa
    I am not aware of any functionality to conditionally display the post element text on its own. However there are 2 ways around this.
    1) If when entering the page you want to decide if you should display the text you could, after each item add a display only item and put a condition on that. Changing the display only items displayed properties to Begin On New Line = NO and Field = NO will give the impression of post element text
    2) If you want to conditionally display the text dependent on what the user has entered into the box you could use some javascript in the post element text field. e.g.
    &lt;span id="me"&gt;&lt;/span&gt;
    &lt;script language="javascript"&gt;
    function test1(){
    if (1 + 1 == 2){
    document.getElementById("me").innerHTML = "sometext";
    &lt;/script&gt;
    then in the html form element attributes field you can call this function like this:
    onblur="test1()"
    Hope that helps
    Adam

  • Acrobat or Reader: Is there a way to set the print scaling default at the application level?

    Is there a way to set the Page/Print Scaling to a default at the application level? For Acrobat and Reader?
    Thanks,

    Often asked, but that feature retains the last used local setting.
    You can however, change the default for Documents, individually, in their Properties > Advanced tab

  • Outer Join or Row-Level Function

    Hi ALL,
    I have a query which involves five tables T1, R1, R2, R3 and R4. T1 is a transaction table, whereas R1, R2, R3 and R4 are reference tables (Parent tables, with foreign keys defined in T1). T1 table always contains R1 and R2 referenced data. BUT T1 table may contain sometimes NULL for R3 and R4.
    Now my question is simple;
    Should i use an OUTER Join for R3 and R4 in the query? like
    <code>
    select T1.col1, R1.col2, R2.col2, R3.col2, R4.col2
    from T1, R1, R2, R3, R4
    where T1.col2 = R1.col1
    and T1.col3 = R2.col1
    and T1.col4 = R3.col1(+)
    and T1.col5 = R4.col1(+)
    </code>
    OR
    Should i use row-level functions for R3 and R4, like
    <code>
    select T1.col1, R1.col2, R2.col2,
    (Select R3.col2 from R3 where R3.col1 = T1.col4),
    (Select R4.col2 from R4 where R4.col1 = T1.col5)
    from T1, R1, R2
    where T1.col2 = R1.col1
    and T1.col3 = R2.col1
    </code>
    which approach is better and why?
    Records in T1 = 2,000,000
    Records in R1 = 1000
    Records in R2 = 300
    Records in R3 = 1800
    Records in R4 = 200
    Please note that all foreign keys are indexed, there are primary keys in all R tables
    Thanks,
    QQ.

    dwh_10g wrote:
    I have preferred to go for Outer Joins, as there might be a possibility, if data grows than there will be more row-level scans; hence slower output in future.
    If i go with a row-level scan, then there will be more usage of Hash tables (Memory), so if more memory is required and our SGA limits is crossed, then there will be more disk I/O i guess. which is a costly operation.
    QQ,
    as already explained, unfortunately it's hard to predict how the "row-level" approach is going to perform in case of increased data volume. Since it is dependent on some factors it could be faster or slower than the outer join approach.
    You shouldn't worry too much about the size of the in-memory table. You haven't mentioned your version, but since your alias is "dwh10g" is assume you're using 10g.
    In 10g the size is defined by the hidden parameter "_query_execution_cache_max_size" and set to 65536 bytes by default. In pre-10g the size is always 256 entries which might grow bigger than 64k in case you have large input/output values (e.g. large VARCHAR2 strings). Compared to potentially multiple several megabytes large sort and/or hash SQL work areas used by each open cursor this table seems to be relatively small.
    I don't think that this memory is taken from the SGA, but belongs to the PGA of the process executing the query and therefore it should not allocate SGA memory (I think even in Shared Server configuration this part should be allocated from the PGA of the shared server process).
    So in summary if your data volume increases it shouldn't have an noticeable impact on the memory usage of the "row-level" approach, and therefore this I think is negligible.
    But as a recommendation I would say, since the "row-level" approach doesn't seem to be significantly faster than the "outer join" approach and it's behaviour in future is hard to predict (e.g. it could become worse if your data pattern changes or the execution plan changes and therefore the order of the row processing changes) I would stick to the "outer-join" approach. I assume it could be more stable in terms of performance.
    Regards,
    Randolf
    Oracle related stuff blog:
    http://oracle-randolf.blogspot.com/
    SQLTools++ for Oracle (Open source Oracle GUI for Windows):
    http://www.sqltools-plusplus.org:7676/
    http://sourceforge.net/projects/sqlt-pp/

  • Process Status & Release Status for Condition Record

    Hi Gurus,
    Pls help me out in the the following scenario.
    I want to activate Authorization level check for Condition records.
    For example, Product price PR00 is being entered by first level.
    After verification done by second level only, that condition record to be used for sales order processing.
    I have gone through Process status & Release Status. But not getting full clarity on this.
    Rgds,
    Senni.B

    Hi,
    Please go through the following information.
    [Relase Procedure for Condition Record|http://help.sap.com/saphelp_47x200/helpdata/en/a4/af9e78e69611d2ace10000e8a5bd28/frameset.htm]
    [Release Procedure for PR|http://www.sap123.com/showthread.php?t=59]
    Reward if helpful.
    Thanks and Regards,
    Naveen Dasari

  • Conditional Display based on Function and Application Item?

    I have a function within my DB that checks if the STAFF_ID (an application level item) is a "Super User" within my application. The function ("is_super-user") returns 1 if the STAFF_ID given is a Super User. (I am not using ApEx users/groups)
    How would I call this function within the Conditional Display of a button?
    I tried the following with no luck... (although it does not give me an error)
    Conditional Type: PL/SQL
    Expression 1: is_super_user(&STAFF_ID.)=1

    Matt is that you? You're not makin it real easy to identify you by name...
    The function ("is_super-user") returns 1...
    That should be is_super_user (without quotes, of course).
    Your previous attempt should have produced an error. But this should work:
    Conditional Type: PL/SQL
    Expression 1: is_super_user(:STAFF_ID)=1
    ...assuming the function has a varchar2 input parameter.
    And then to make it secure, you'll want to make that application item Restricted so nobody can pass in a value from the page. This kind of condition is a good use of authorization schemes which you can name/create once and attach to all sorts of components throughout the app. Speaking of other components, you should protect DML processes using the same condition/authorization scheme because just because there is no button visible on the page doesn't mean someone can't put one there and submit the page anyway.
    Scott

  • Conditional display using Pl/SQL function body returning a boolean

    I am having issues with conditional display of a report.
    I have to select lists: p50_facility and p50_supervisor.
    I have entered the below pl/sql function body returning a boolean
    Begin
    if (:p50_facility is null or
    :p50_supervisor is null) THEN
    Return False;
    Else
    Return True;
    End if;
    End;
    No matter what values my items are set to (null, not null), the report shows.
    What am I doing wrong?

    Hi,
    The values for the lists will be null only until the first time the page is submitted. Thereafter, the value is likely to be '%null%'
    You will need to do something like:
    BEGIN
    IF (:P50_FACILITY IS NULL OR :P50_FACILITY = '%' || 'null%' OR :P50_SUPERVISOR IS NULL OR :P50_SUPERVISOR = '%' || 'null%') THEN
      RETURN FALSE;
    ELSE
      RETURN TRUE;
    END IF;
    END;Andy

  • Conditional display of region with PL/SQL function returning SQL query

    Hello,
    ApEx 2.0.
    I use PL/SQL functions that return SQL queries to display the contents of a region.
    How could I conditionally display such region ? If no data is found, the region shouldn't be shown. I tried with "SQL query returns at least one row" but this doesn't seem to work.
    Thanks,
    Matthias

    Hi Matthias,
    Are the regions in question report regions? So your PL/SQL process is returning a SQL query and then populating a report?
    The EXISTS(SQL Query returns at least one row) condition should work, try running the query you are using in the Expression 1 textarea inside SQL*Plus, or SQL developer using the same parameters, and see what gets returned.
    If you are still stuck, can you post the query you are using inside your Expression 1 textarea of the Conditions section and I can take a look at it for you.
    Hope this helps,
    Cj

Maybe you are looking for