SQL Query (updateable report) Region - Conditionally Hide and Set Values

SQL Query (updateable report) Region - Conditionally Hide and Set Values
Outline of requirement :-
Master / Detail page with Detail updated on same page using SQL Query (updateable report).
The detail region has the following source
SELECT item_id,
       contract_id,
       CASE WHEN hardware_id IS NOT NULL THEN
               'HA'
            WHEN backup_dev_id IS NOT NULL THEN
               'BD'
            WHEN hardware_os_id IS NOT NULL THEN
               'HS'
       END item_type,
       hardware_id,
       backup_dev_id,
       hardware_os_id
FROM   "#OWNER#".support_items
WHERE  contract_id = :P26_CONTRACT_IDThe table support_items implements arced relationships and has the following columns
CREATE TABLE SUPPORT_ITEMS
  ITEM_ID         NUMBER                        NOT NULL,
  CONTRACT_ID     NUMBER                        NOT NULL,
  HARDWARE_ID     NUMBER,
  BACKUP_DEV_ID   NUMBER,
  HARDWARE_OS_ID  NUMBER
)A check type constaint on support_items ensures that only one of the fk's is present.
      (    hardware_id    IS NOT NULL
       AND backup_dev_id  IS NULL
       AND hardware_os_id IS NULL
OR    (    hardware_id    IS NULL
       AND backup_dev_id  IS NOT NULL
       AND hardware_os_id IS NULL
OR    (    hardware_id    IS NULL
       AND backup_dev_id  IS NULL
       AND hardware_os_id IS NOT NULL
      )    Hardware_Id is a FK to Hardware_Assets
Backup_dev_id is a FK to Backup_Devices
Hardware_os_id is a FK to Hardware_op_systems
The Tabular Form Element based on item_type column of SQL query is Displayed As Select List (based on LOV) referencing a named list of values which have the following properties
Display Value     Return Value
Hardware Asset    HA
Backup Device     BD
Computer System   HSThe Tabular Form Elements for the report attributes for hardware_id, backup_dev_id and hardware_os_id are all Displayed As Select List (Based on LOV).
What I want to do is only display the Select List for the FK depending on the value of the Select List on Item Type, e.g.
Item_Type is 'HA' then display Select List for hardware_id, do not display and set to NULL the Select Lists for backup_dev_id and hardware_os_id.
Item_Type is 'BB' then display Select List for backup_dev_id, do not display and set to NULL the Select Lists for hardware_id and hardware_os_id.
Item_Type is 'HS' then display Select List for hardware_os_id, do not display and set to NULL the Select Lists backup_dev_id and hardware_id.
There are properties on elements to conditionally display it but how do we reference the values of the SQL query Updateable region? they are not given a page item name?
Also on the Tabular For Elements there is an Edit tick against a report item - however when you go to the Column Attributes there is not a property with which you can control the Edit setting.
What's the best way of implementing this requirement in APEX 3.1?
Thanks.

>
Welcome to the forum: please read the FAQ and forum sticky threads (if you haven't done so already), and update your profile with a real handle instead of "user13515136".
When you have a problem you'll get a faster, more effective response by including as much relevant information as possible upfront. This should include:
<li>Full APEX version
<li>Full DB/version/edition/host OS
<li>Web server architecture (EPG, OHS or APEX listener/host OS)
<li>Browser(s) and version(s) used
<li>Theme
<li>Template(s)
<li>Region/item type(s) (making particular distinction as to whether a "report" is a standard report, an interactive report, or in fact an "updateable report" (i.e. a tabular form)
With APEX we're also fortunate to have a great resource in apex.oracle.com where we can reproduce and share problems. Reproducing things there is the best way to troubleshoot most issues, especially those relating to layout and visual formatting. If you expect a detailed answer then it's appropriate for you to take on a significant part of the effort by getting as far as possible with an example of the problem on apex.oracle.com before asking for assistance with specific issues, which we can then see at first hand.
I have a multi-row region that displays values and allows entries in a number of fields.Provide exact details of how this has been implemented. (An example on apex.oracle.com is always a good way to do this.)
I should like the fields to be conditional in that they do not permit entry, but still display, if certain conditions apply (e.g. older rows greyed out). Can this be done? Almost anything can be done, often in multiple ways. Which are appropriate may be dependent on a particular implementation, the skills available to implement it, and the effort you're willing to expend on it. Hence it's necessary to provide full details of what you've done so far...

Similar Messages

  • Apex conditional field in "SQL Query (updateable report)" region

    I have a multi-row region that displays values and allows entries in a number of fields. I should like the fields to be conditional in that they do not permit entry, but still display, if certain conditions apply (e.g. older rows greyed out). Can this be done?
    I have searched Google and this forum but all the threads I have found relate to field formatting or display/non-display.
    Many thanks in advance Dave Barber
    [Apex=4.1.1.00.23; Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production]
    Edited by: user13515136 on 03-Sep-2012 00:05

    >
    Welcome to the forum: please read the FAQ and forum sticky threads (if you haven't done so already), and update your profile with a real handle instead of "user13515136".
    When you have a problem you'll get a faster, more effective response by including as much relevant information as possible upfront. This should include:
    <li>Full APEX version
    <li>Full DB/version/edition/host OS
    <li>Web server architecture (EPG, OHS or APEX listener/host OS)
    <li>Browser(s) and version(s) used
    <li>Theme
    <li>Template(s)
    <li>Region/item type(s) (making particular distinction as to whether a "report" is a standard report, an interactive report, or in fact an "updateable report" (i.e. a tabular form)
    With APEX we're also fortunate to have a great resource in apex.oracle.com where we can reproduce and share problems. Reproducing things there is the best way to troubleshoot most issues, especially those relating to layout and visual formatting. If you expect a detailed answer then it's appropriate for you to take on a significant part of the effort by getting as far as possible with an example of the problem on apex.oracle.com before asking for assistance with specific issues, which we can then see at first hand.
    I have a multi-row region that displays values and allows entries in a number of fields.Provide exact details of how this has been implemented. (An example on apex.oracle.com is always a good way to do this.)
    I should like the fields to be conditional in that they do not permit entry, but still display, if certain conditions apply (e.g. older rows greyed out). Can this be done? Almost anything can be done, often in multiple ways. Which are appropriate may be dependent on a particular implementation, the skills available to implement it, and the effort you're willing to expend on it. Hence it's necessary to provide full details of what you've done so far...

  • Validation of a Region defined as type SQL QUERY (Updateable Report)

    Hi,
    I am trying to perform some validation on a Region defined as type SQL QUERY (Updateable Report). The report has two columns.
    One of the columns is a Select List and I would like to insure that a user cannot select the same value twice
    in the report. For example, if the select list has 5 values, A, B, C, D, E, I don't want a user to be able to select
    B twice in the report. I am assuming that I will need to incorporate javascript
    into my validation logic in order to perform this task. If so, could someone provide some guidance? Or are there
    other alternatives.
    Thanks in advance,
    Michael

    Dan,
    Sorry, I didn't mean to post the question twice. I was trying to edit my original question. Thanks for the link to the website. I am new to APEX development so the website you gave me will be extremely useful to learn new development techniques.
    Thanks again,
    Michael

  • Is there a simple way to refresh a SQL Query (Updatable report) region

    I have a page in APex 4.1 that has many regions. I would like to be able to refresh a single region.
    Currently, I have the following
    Region (sql query updateable report).
    STATIC ID = LANDINGS
    in the region footer, I have:
    <script type="text/javascript">
    $s('P110_LANDINGS_REGION_ID','#REGION_STATIC_ID#');
    </script>
    P110_LANDINGS_REGION_ID is a hidden field.
    I use javascript to refresh....but it does not seem to be working. Previously, we had hard-coded the region id ( $a_report('1363338167540162011','1','100','100');) ...but that ID was somehow corrupted, which has lead me to the 'OMG...there must be an easier way!' lament.
    the javascript is:
    $a_report('P110_LANDINGS_REGION_ID','1','100','100');
    thanks!
    Karen
    ps. could I just directly reference the static id in my javascript...
    $a_report('LANDINGS','1','100','100');

    Karen,
    First off: please post code in &#123;code&#125;...&#123;code&#125; tags!
    function AddFavoriteSpecies()
    get = new htmldb_Get(null,&APP_ID.,'APPLICATION_PROCESS=favorite_species_collection',0);
    gReturn = get.get();
    rowCount = rowCount + parseInt(gReturn);
    pHMS_add = '&G_HMS_FLAG.';
    $a_report('1363338167540162011','1','100','100');
    //$a_report($x('P110_LANDINGS_ID').value,'1','15','15');the statement:
    $a_report('1363338167540162011','1','100','100'); works, but the statement $a_report($x('P110_LANDINGS_ID').value,'1','15','15'); does not.
    Can anyone help.
    I am assigning the page field P110_LANDINGS_ID in the footer of a region with a static id = LANDINGS.
    <script type="text/javascript">
    $s('P110_LANDINGS_ID','#REGION_STATIC_ID#');
    </script>
    Well, let's start by dumping $a_report. This is undocumented code, and it has long been replaced by triggering a refresh.
    Next, don't use $x(pNode).value to retrieve a value. Rather use $v(pNode) to do this.
    function AddFavoriteSpecies()
       get = new htmldb_Get(null,&APP_ID.,'APPLICATION_PROCESS=favorite_species_collection',0);
       gReturn = get.get();
       rowCount = rowCount + parseInt(gReturn);
       pHMS_add = '&G_HMS_FLAG.';
       //get the region id from the item
       //use it in a jQuery selector to get the region
       //trigger the refresh event on this object
       $("#" + $v('P110_LANDINGS_ID')).trigger('apexrefresh');
    }Now if you want to make sure that P110_LANDINGS_ID contains a value, add an alert with its value before you use it.
    alert('P110_LANDINGS_ID value: '+$v('P110_LANDINGS_ID'))

  • Create a validation for SQL Query (updateable report)

    Hello
    I have a need for creating a validation on a SQL Query (updateable report)- type region
    1)
    When a row get populated i don't want same values to be populated in the second row.(as shown in first 2 rows)
    Also, I don't want to have a value that falls in range in between 100 and 1000 for the period falls in the previous. (as shown in third row)
    i.e
    Type_id
    Lower_Limit        Upper_Limit           Date_From       Date _To
    1
    100                      1000                   1/1/2013        12/31/2013
    2
    100                      1000                    1/1/2013        12/31/2013
    3
    101                       500                    2/1/2013        10/31/2013
    appreciate any help
    thanks
    kp

    This example could help:
    http://apex.oracle.com/pls/otn/f?p=31517:214
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://apex.oracle.com/pls/otn/f?p=31517:1
    -------------------------------------------------------------------

  • Type: SQL Query (updateable report)

    Hello,
    Is it possible to default a field value in a SQL Query (updateable report) Report Region in a DML Form when the 'Add Row' button is clicked? I want to default some List of Value fields. This is not as simple as a HTML Region Item based on a table, there is a 'Default' tab where the field value goes. Any help is appreciated, thanks.

    Hi,
    On the tabular form's Column Attributes tab, select the column. You should see a section headed "Tabular Form Element". In there, there are two settings you can use: Default Type and Default
    Andy

  • Update Field On Change For A SQL Query (updateable report)

    Hi,
    I'd like to request help from anyone with ideas on how to solve this.
    We are using APEX 4.2, 10GR2, RedHat5.
    I have a report that comes from SQL Query (updateable report).
    I'm using the apex_item.text and apex_item.hidden on fields.
    I'm using a button to submit and after submit process to add some logic that I need.
    There could be 1 - 10 records in the report.
    There is only 1 field that is needed to enter a value, but the value of this field determines the value of another field.
    I think that I can do this with a submit button and an after submit process where I loop through all the records. I think I have this handled.
    This is the question
    When the value of that field is changed then the value of another field in the same row changes immediately.
    Is this possible?
    All the examples I've seen so far are for a single record and that doesn't work for us.
    I guess this is a MRU process but I haven't seen an example where a dynamic action is possible on a Multi Row Update.
    Could anyone direct me to where I can see an example or help me get directions?
    I appreciate all your help an comments and I thank you in advance.

    Yes why not...what you looking for is a ajax call
    See {message:id=10390979}
    Please note:-you can also do this as a dynamic action as shown below
    Event: Change
    Selection type: jQuery Selector
    jQuery Selector: input[name="f01"]
    True action with Execute JavaScript Code and put all code inside the test funtion, you may need to amend the code to use this.triggeringElemnt in place of this

  • SQL Query (updateable report) - Can't figure out how to make one

    Hi folks,
    Can someone tell me how to make a report where the data can be updated? Not an interactive report, a SQL report that selects only one row. The only options in the drop down I see are "SQL Query" and "SQL Query (PL/SQL function body returning SQL query)", but I have a report elsewhere that says it's type is "SQL Query (updateable report)", but I can't remember how to do it :(
    Thanks very much,
    -Adam

    Hi Adam,
    An Updatable Report is a "Tabular Form" - see: http://download.oracle.com/docs/cd/E10513_01/doc/appdev.310/e10497/frm_tabular.htm#CHDFBHDB
    Andy

  • APEX 4.1, SQL Query(Updateable report), Validation issue.

    Hi,
    I am using APEX 4.1.
    I have SQL Query(Updateable report), we have created validation for the columns in this report.
    The validations are working properly only for the first row of the report on submitting, the remaining rows are not getting validated.
    If we check mark the rows it will get validated, but we want the validation to happen without checkmarking, on all the rows on clicking submit button.
    Can someone help me to fix this issue?
    Thanks in advance.
    Thanks & regards,
    Ravi.

    Hi Ravi,
    Welcome to Oracle Forums!
    Please acquaint yourself with the FAQ and forum etiquette if you haven't already done so.
    Always state
    <ul>
    <li>Apex Version</li>
    <li>DB Version and edition</li>
    <li>Web server used.I.e. EPG, OHS, ApexListner Standalone or with J2EE container</li>
    <li>When asking about forms always state tabular form if it is a tabular form</li>
    <li>When asking about reports always state Classic / IR</li>
    <li>Always post code snippets enclosed in a pair of &#123;code&#125; tags as explained in FAQ</li>
    </ul>
    I am using APEX 4.1.I have SQL Query(Updateable report), we have created validation for the columns in this report.
    The validations are working properly only for the first row of the report on submitting, the remaining rows are not getting validated.
    If we check mark the rows it will get validated, but we want the validation to happen without checkmarking, on all the rows on clicking submit button.
    Can someone help me to fix this issue?
    >
    Post your validation code with some explanations of what the g_fnn are.
    Cheers,

  • Problem With SQL Query (updateable report)

    Hi,
    I have a report which I have set as type 'SQL Query (updateable report)'. I have added a 'row selector' to the report but when I run it I get the following error message:
    failed to parse SQL query:
    ORA-00904: "COL60": invalid identifier
    The report works fine if I remove the row selector. Any ideas as to why the error is being produced?
    Cheers
    Simon

    I don't have the apex_application.g_f01(i) referenced in the page source...In the page source you wouldn't find anything by that name
    Identify the tabular form's checkbox column in the page(firebug/chrome developer panel makes this easy)
    It should be like
    &lt;input id=&quot;...&quot; value=&quot;&quot; type=&quot;checkbox&quot; name=&quot;fXX&quot; &gt;we are interested in the name attribute , get that number (between 01 and 50)
    Replace that number in the code, for instance if it was f05 , the code would use
    apex_application.g_f05
    --i'th checked record' primary keyWhen you loop through a checkbox array, it only contains the rows which are checked and it is common practice to returns the record's primary key as the value of the checkbox(available as the the i'th array index as apex_application.g_f05(i) , where i is sequence position of the checked row) so that you can identify the record.

  • Setting the cell width in a Tabular Form (SQL Query (updateable report) )

    version 3.2.1
    I have a Tabular Form (SQL Query (updateable report) ) and I have a column that is a VARCHAR2(4000) that when displayed extends the cell to the full length (which of course makes sense).
    How can I set the width of this cell to something like 30 or 50 and wrap the contents?
    Thanks,
    Joe

    Scott,
    Thank you for replying.
    Your suggestion kinda worked. I say kinda because when the report is first displayed the cell is the full width and appears to ignore the width setting. There is a Select List on the report to restrict some of the data that is displayed. When a selection is made from this Select List, it appears that the cell width is then adjusted to what was set, but not for every selection from this Select List.
    I made the width entry in Tabular Form Element - Element Width
    Any idea why the width setting is ignored?
    Thanks,
    Joe

  • Sql Query(Updateable Report) with pagination

    Hi,
    We're on APEX 3.2 I have a question on Sql Query(Updateable Report) and pagination. I have an updateable report which we have set to show 20 rows. When the userwhi has more than 20 rows enters the data and clicks next the data disappears. I have been reviewing other posts, but haven't come to a clear conclusion on how to prevent this from happening. I have been trying to use javascript to show a save popup when clicking 'Next' Any help is appreciated.
    Thanks,
    Joe

    any ideas?

  • SQL Query updateable report with row selector. Update process.

    I have a SQL Query updateable report with the row selector(s).
    How would I identify the row selector in an update process on the page.
    I would like to update certain columns to a value of a select box on the page.
    Using the basic:
    UPDATE table_name
    SET column1=value
    WHERE some_column=some_value
    I would need to do:
    UPDATE table_name
    SET column1= :P1_select
    WHERE [row selector] = ?
    Now sure how to identify the [row selector] and/or validate it is checked.
    Thanks,
    Bob

    I don't have the apex_application.g_f01(i) referenced in the page source...In the page source you wouldn't find anything by that name
    Identify the tabular form's checkbox column in the page(firebug/chrome developer panel makes this easy)
    It should be like
    &lt;input id=&quot;...&quot; value=&quot;&quot; type=&quot;checkbox&quot; name=&quot;fXX&quot; &gt;we are interested in the name attribute , get that number (between 01 and 50)
    Replace that number in the code, for instance if it was f05 , the code would use
    apex_application.g_f05
    --i'th checked record' primary keyWhen you loop through a checkbox array, it only contains the rows which are checked and it is common practice to returns the record's primary key as the value of the checkbox(available as the the i'th array index as apex_application.g_f05(i) , where i is sequence position of the checked row) so that you can identify the record.

  • Change "SQL Query" report to "SQL Query (updateable report)" report?

    I manually made a report, because the tabular report made by the wizard gave me no possibility to use a popup LOV. Now I have this report, but I cant apply an MRU process on it, becuase it's not an "SQL Query (updateable report)". How can I change my report to a "SQL Query (updateable report)"? I only can choose between SQL Query and SQL QUERY (PL/SQL function body returning SQL query).

    Hi Tom
    You can just write the processes yourself. Although trickier this can give you a lot more control over row processing.
    APEX_APPLICATION.G_F01, F02 etc are global variables in the apex_application package that are defined as arrays.
    These are regularly used in tabular forms to reference values within them. The normal ordering would be column 1 = G_F01, column 2 = G_F02 etc etc. Although you can change these and even assign more than one column to an array.
    The example
    FOR i IN 1..APEX_APPLICATION.G_F01.COUNT LOOP
    INSERT INTO my_table VALUES(:P1_EMPID , APEX_APPLICATION.G_F01(i));
    END LOOP;Is saying - for the number of values in the array G_F01 (probably column 1) loop insert into the table the value of the associated value in the array. So first time through i=1 - so the first value in the array (probably row 1 in column 1), next time i=2 so the second value in the array is used (probably row 2 in column 1) and so on...
    When you've created a manual tabular form (what I would call what you've done) you have created the items using the APEX_ITEM package in your query. The first parameter for this is p_idx which defines which global array to hold it in.
    Cheers
    Ben

  • Possible APEX BUG - Export to CSV from SQL Query (updateable report)

    I'm getting a the following sql error - just by enabling the Export to a CSV file from a SQL Query (updateable report) and selecting the export link - anyone have an idea what I could as a workaround?
    ORA-06550: line 1, column 45: PLS-00103: Encountered the symbol "1" when expecting one of the following: begin case declare exit for goto if loop mod null pragma raise return select update while with <an identifier> <a double-quoted delimited-identifier> <a bind variable> << close current delete fetch lock insert open rollback savepoint set sql execute commit forall merge pipe
    Error ERR-1000 Unable to determine LOV from "declare function x return varchar2 is begin 1 Not Checked;1 Not Checked,2 Review Passed;2 Review Passed,3 Reviewed w/ Issues;3 Reviewed w/ Issues,4 Not Applicable;4 Not Applicable return null; end; begin wwv_flow_utilities.g_query := x; end;".
    OK
    report error:
    ORA-20001: Error fetching column value: ORA-20001: Query must begin with SELECT or WITH

    Frank,
    I received your email with this same question so I'll just respond here. Our internet-facing hosted site apex.oracle.com allows you to request a workspace and, after the request is approved and the workspace provisioned, to develop applications there. If you already have an application that you need some help with, you can import/install it into your workspace on apex.oracle.com. This makes it easy to demonstrate problems to others who might be able to help.
    Sometimes it will be necessary for you to create developer accounts in your workspace in order for others to use your Application Builder. You can post usernames/passwords here or you can convey those privately to those offering their services. In either case, you'd want to remove or disable those accounts as soon as the problem is resolved. For problems that I ask to see demonstrated on apex.oracle.com, it is not necessary for you to create an account for me. I can do that as our group runs the site. I just need to know your workspace name and application ID.
    Scott

Maybe you are looking for

  • Solution manager 4.0

    We want exporting settings Maintenance Optimizer. How to fix it? Best regards, Maksim

  • Need help with PhotoMerge Panorama

    Can someone help me with PhotoMerge Panorama in PE 13? I upgraded from version 6 and now cannot adjoin separate images into one image. Every time I try I get this message: "Panorama could not be created as some images could not be automatically align

  • Native installer .deb package name

    Hi all, I am packaging a .air file into a native .deb linux installer. It is working fine but the package name is set automatically to a long string that is formed by application <id> and <publisherid> concatenated. Is there a way to set a custom pac

  • How to fix ICC profile errors?

    I just brought Photoshop CS6 lately and I am trying to edit a picture but I get this message: "The embedded ICC profile cannot be used because the embedded ICC profile is invalid. Ignoring the profile" " What do I do to fix this? Please provide clear

  • Trip schema PL does not exist in the system (T706S)

    Hi Guru's, I have configured Travel Management. When saving Travel request tcode - 'TRIP', it gives an error 'Trip schema PL does not exist in the system (T706S) Message no. PTRA_WEB_INTERFACE036'. I have maintained schema for Variant '40' Indian Acc