Setting default value to columns on tabular form is not working.

Hi,
I created a tabular form and i want to set some default values to columns based on the values in page items.
so i set the page item to column value in tabular form attributes by selecting the Default type as PLSQL Expression & Function DEFAULT value &P24_ISSUE_ID. it worked fine but
in the similar way i tried for the another column by selecting the default type as pl/sql expression & function and default value &P24_CASE_NAME.
but it throwing an error for this like failed to parse SQL query:    ORA-00904: "C254DB": invalid identifier
i don't understand where i gone wrong even i checked for the data types of the columns, everything is fine.
so please help me out of this problem.

Tulasi 1243 wrote:
for the first column
i selected
DEFAULT TYPE as PL/SQL Expression & FUNCTION
Default as *&P24_ISSUE_ID.* This is a number data type column
2nd column
Default Type as PL/SQL Expression & Function
Default as *&P24_CASE_NAME.* This is Varchar2 data type column.The appropriate options for a default value from a page item are Item (application or page item name) for Default Type and the item name ( P24_ISSUE_ID, P24_CASE_NAME etc) for Default.
*&P24_ISSUE_ID.* is not a "PL/SQL Expression or Function".
but it throwing an error for this like failed to parse SQL query: ORA-00904: "C254DB": invalid identifierWhat you are doing results in the APEX engine substituting the P24_CASE_NAME value "C254DB" into the default value and then trying to evaluate this string as a piece of PL/SQL. Outside of a block in which it is defined as a variable, constant or function "C254DB" is not a valid PL/SQL expression.

Similar Messages

  • Sorting on date (date_popup2) in manual tabular form does not work

    Hi All,
    I created a manual tabular form (based on a collection) with 1 date_popup2 field in it. This field is defined in the query as follows:
    ,      apex_item.date_popup2( p_idx                   => 18
                                , p_value                 => c004
                                , p_date_format           => 'dd-mm-yyyy'
                                , p_item_id               => 'f18_' || lpad (rownum, 4, '0')
                                , p_item_label            => 'Start date'
                                ) as tf_br_start_date
    In the report attributes I marked this column to be sortable.
    However, in the page the sorting is not working. It looks like it's always sorted in the order  of the seq_id.
    Can anyone tell me how to solve this?
    Regards,
    René

    I'd call it a bug/missing feature.
    It appears that within a Basic report, sorting on a column created using APEX_ITEM.DATE_POPUP2() does not sort by date.
    I'd file this with Oracle Support and see what they say.
    Include a link to this thread and your workspace login information.
    I got something to work by: (probably not what you want.)
    using the C004 column directly. (I just added it to the SQL code)
    setting the column's attribute "Display As" to "Date Picker"
    setting the column's attribute "Number /Date Format" to DD-MM-YYYY
    I suspect: since you don't start with p_idx => 1, this column becomes "1" ==> g_f01
    MK

  • Tabular Form Validation not working in tabular form APEX 4.0

    Hi,
    I am using APEX 4.0. I have a tabular form with Tabular form validation done with it.
    Item not null is the validation.. so if I dont type any value in the any of the fields in the tabular form and press the Submit button, the first time error is shown... but when I click the Submit button again, with still the empty rows the page is submitted.
    How to resolve this issue?
    Edited by: Suzi on Oct 5, 2010 11:13 AM

    Look at this thread - Re: Validations of tabular forms in 4.0

  • Insert in Tabular form does not work after the upgrade to APEX 4.0

    Hi all,
    Thx in advance for looking into the issue.
    We are running into following issue when we upgraded APEX 3.2 to APEX 4.02
    1) The Tabular form insert does not work.
    2) We are fatching the value of the Global variable APEX_APPLICATION.g_XXXX in a procedure and we get null for this value after submit for new row to be inserted.
    The tabular form was working fine in APEX 3.2.
    The Update and Delete works just fine.
    Any help in this regard is highly appreciated.
    Thx and regards,
    Mahesh

    Here is my workaround to get the ADDROW/SUBMIT working again if you have a legacy Tabular Form:
    1     PAGE ATTRIBUTES               
              JAVASCRIPT          
              FUNCTION AND GLOBAL VARIABLE DECLARATION          
                   var htmldb_delete_message='"DELETE_CONFIRM_MSG"';     
    2     DELETE BUTTON               
              ACTION WHEN BUTTON CLICKED          
              URL Target          change to
                   javascript:apex.confirm(htmldb_delete_message,'MULTI_ROW_DELETE');     
    3     ADDROW BUTTON               
              ACTION WHEN BUTTON CLICKED          
              Action           
                   redirect to URL     
              URL Target          
                   javascript:addRow();     
    4     PROCESS               
              APPLYMRU (activitated by button ADDROW)          
              CONDITION          
                   never or delete     
    5     PROCESS               
              ADDROWS          
              CONDITION          
                   never or delete     
    6     CHANGE PAGE TEMPLATE to e.g. THEME 13 One Level Tabs.               
    7     IF YOU WANT ADD FUNCTIONALITY TO GOTO BOTTOM OF PAGE AFTER ADDROW               
         1. In the page footer put <a name="bottom_of_page"></a>                
         2. Amend the action when the "ADD" button is clicked to scroll down to the new region by doing the following:               
         - edit "ADD" button               
         - Go to "Action when button Clicked" section               
         - Amend "URL Target" from               
         javascript:addRow();                
         to               
         javascript:addRow();window.location='#bottom_of_page' ;               
    regards
    PaulP

  • Setting the value of a JScrollBar inside a JScrollPane not working.

    I have a display area (JPanel) inside a JScrollPane. What i want to do is that every time the user closes my application a file is saved with some preferences, like position and size onscreen, and the values of the scrollbars. My problem is that when I try to set the values of the JScrollBars, they seem to be completely ignored.
    I made a small class to illustrate this:
    import java.awt.*;
    import javax.swing.*;
    public class ScrollExample extends JFrame
         private JPanel display;
         private JScrollPane displayScroll;
         public ScrollExample()
              display = new JPanel();
              display.setPreferredSize( new Dimension( 800, 600 ) );
              displayScroll = new JScrollPane( display );
              add( displayScroll );
              setSize( 400, 300 );
              setVisible( true );
              displayScroll.getHorizontalScrollBar().setValue( displayScroll.getHorizontalScrollBar().getMaximum() );
         public static void main( String args[] )
              new ScrollExample();
    }The behaviour of is as intended. However if we switch the two lines to be:
    displayScroll.getHorizontalScrollBar().setValue( displayScroll.getHorizontalScrollBar().getMaximum() );
    setVisible( true );and launch it, the scrollbar appears to have moved only a small amount. This leads me to believe that it has something to do with the main window being visible. In my actual application, this call to setValue is ignored, unlike in this sample one. Even placing it after the setVisible call, it does not do anything.
    When I tried to use:
         Runnable doScroll = new Runnable()
                 public void run()
                      taskDisplayScroll.getHorizontalScrollBar().setValue( 200 );
             SwingUtilities.invokeLater(doScroll);after the setVisible call, as mentioned on http://forum.java.sun.com/thread.jspa?threadID=723424, it rarely (maybe 3 out of 20 times) sets the scrollbar to the indicated value.
    My question is this: What does the setValue() call depend on to run properly, and how do I code it to work in my program?
    If you need any additional information, please ask.
    Note: In the sample class I provided, the scrollbar moves to its proper spot, I could not cause it to not move at all, as is the case in my application that seems to have the same calls.
    Thanks, Serge.
    Edited by: super_serge on Jun 26, 2008 8:23 AM

    Can you please explain to me how b) would be implemented.Read the Swing tutorial on Concurrency for the new approach in JDK1.6, or I still prefer to use SwingUtilities.invokeLater for somthing simple like this.

  • HOW TO SHOW A DEFAULT VALUE IN AN UPDATABLE TABULAR FORM

    I have an updatable form that has three columns:
    Employee Name (display only)
    Reporting Name (select list)
    Element Type ID (hidden and updatable)
    When the user select a value in the reporting name column it updates the
    element type id with the appropriate value. But when they look at the select list
    it has the select list values as well as the selected value in the list. How do I
    overcome this. My example is setup and ready to be reviewed at http://apex.oracle.com/pls/otn/f?p=32409:1
    Thank you
    Forrest
    p.s. weather in Anchorage Alaska Sunny and 45 degrees!

    Woody,
    I'm a little confused (not uncommon), as I don't understand why you have a hidden column to hold the element_type_id value.
    It looks like you're doing a simple SELECT LIST/LOV that shows the display value and stores the code value. I guess I don't understand why you need the hidden column. Shouldn't the code value end up in the APEX_ITEM array, so you can save it to your table?
    I would think you'd have a hidden value to hold the primary key for your table in one APEX_ITEM array, and the element_type_id column is the second parameter of the APEX_ITEM.SELECT_LIST() call. Then your manual update procedure saves that value to the right record, using the primary key from the hidden column?
    What am I missing here?
    Good luck,
    Stew

  • Updating a table through a manually created tabular form does not work.

    Hi Friends,
    I don't know why the "On submit - After computations and validations" process does not update the referenced table. May I miss something. Here is my source :
    select
    apex_item.hidden(1,eqp_id) id,
    apex_item.hidden(2,tcs_tcs_id) tcs,
    apex_item.text(3,eqp_equip_name,50) name,
    apex_item.text(4,eqp_equip_ident,50) ident,
    apex_item.text(5,eqp_equip_type,15) type
    from equip_physical
    where tcs_tcs_id = :P1_TCS_ID
    and here is the process source
    FORALL i IN 1..apex_application.g_f01.count
    UPDATE equip_physical
    SET eqp_equip_name=apex_application.g_f03(i),
    eqp_equip_ident=apex_application.g_f04(i),
    eqp_equip_type=apex_application.g_f05(i)
    WHERE eqp_id=apex_application.g_f01(i);
    No error message is displayed and my success message associated to the process is displayed. But the modified text field value is erased and the database table is not updated.

    I'd call it a bug/missing feature.
    It appears that within a Basic report, sorting on a column created using APEX_ITEM.DATE_POPUP2() does not sort by date.
    I'd file this with Oracle Support and see what they say.
    Include a link to this thread and your workspace login information.
    I got something to work by: (probably not what you want.)
    using the C004 column directly. (I just added it to the SQL code)
    setting the column's attribute "Display As" to "Date Picker"
    setting the column's attribute "Number /Date Format" to DD-MM-YYYY
    I suspect: since you don't start with p_idx => 1, this column becomes "1" ==> g_f01
    MK

  • Add rows to tabular form does not work

    When two user try to "Add row" simultaneously then nothing happens i.e no new row is added.
    When one of the user clicks on the "Previous" pagination buttons then only its possible to add a new row. The following pagination options is used in the report:
    Row Ranges 1-15 16-30 in select list (with pagination)
    I use internal Application Express account credentials and login page in this application as my authentication scheme.

    Any idea, what is not working here.
    Help!

  • How to set default values for boolean columns

    I'm trying to deploy some content types and columns into a site with a feature. All it's ok, except that I'm trying to set a default value for boolean columns with no success.
    I've tried to set default value at column level:
    <Field ID="{EFE23A1D-494E-45cf-832E-45E41B17F0CF}" Name="ScopeSpanish" DisplayName="Se publican noticias en español"
    Type="Boolean" Hidden="FALSE" Group="Columnas ShaCon" >
    <Default>TRUE</Default>
    </Field>
    and at content type level:
    <FieldRef ID="{EFE23A1D-494E-45cf-832E-45E41B17F0CF}" Name="ScopeSpanish" DefaultValue="TRUE" Required="TRUE" />
    But in any case, when i create a new item with this content type, default value is applied.
    Can anyone tell how to set default values for boolean columns?
    Thanks in advance,
    Regards,
    Sergio

    In the field definition you can set
    <Default>1</Default>
    or
    <Default>0</Default>
    How to set the default value Null?

  • How to Set Default Value into a Tabular Form Element

    Hi,
    Hoping someone can assist with my Tabular Form query.
    I am using Oracle ApEx v3.0.1
    I was wondering how one can set a default value to one of my tabular form columns within Oracle ApEx v3.0.1 as I cannot see how to do it?
    Thanks.

    Hi Tony
    can you pl. help me how you resolve this? I have one tabular form and I am trying to set default value as :APP_USER, I type this in default value but somehow it is not displaying this value.
    thanks
    Dax

  • How to set value on MRU insert Tabular Form

    This post refers to the forum article found How to set value on MRU insert Tabular Form
    I have included the problem and proposed solution below. My problem follows
    Problem
    Hi,
    I am using a Tabular Form. I used the wizard and it created all of the items (Cancel, Submit, Add, Multidelete buttons, etc.). I have a table that is like an FK table. For instance, we could have a customer table, and then a customer address table. Each customer could have multiple addresses. In the address table, the first ID column is the customer ID. So in using the tabular form for the addresses, I need to make the first column the same when I insert. But when I choose add row, everything works fine except it tries to insert a null into customer id. The uniqueness of the row is determined by customer ID and address string.
    Any time I make it to this screen, all new rows will have the same ID with I have in a variable that I can reference from the page called :P0_ITM_CUST_ID.
    How do I set the first value for all inserts? My guess is I need to do this in Computations. I'm also guessing I need to do this with a replace statement. I'm just not sure how to reference the first column of the new row.
    Thanks!
    Tim
    Solution
    The way to do this is by using the "Default" value for that Column. Go to
    Home>Application Builder>Application xxx>Page yyy>Report Attributes>Column Attributes
    Set the default value for newly added rows as in
    http://img237.imageshack.us/img237/5758/screenshot012di2.jpg
    Hope this helps.
    Un-resolved problem
    have also tried to do this but the fields I see are not the same.
    Please see screenshot=http://krisjones.freewebspace.com/apex.JPG
    I am using the Oracle hosted environment, so 2.2.1.
    To my knowledge I have done the same as the user in the first post. Am I doing something incorrectly or should I have created the tabular form differently?
    Many thanks. Kris

    Kristian - You see a different version of the form depending on whether the selected column is the primary key column or not.
    Scott

  • Setting Default values in portal form

    I have a portal Master/Detail Form. I want to set some of the detail block columns value to the value of a field in the master block.
    In the formattng option of the detail column, I tried setting default value to:
    p_session.get_value_as_varchar2(p_block_name=>'MASTER_BLOCK', p_attribute_name=>'A_CLASS_CD');
    and default value type to: function (I also tried expression). It compiles, but gives me an error when I ry running form. How can you set the default value (from the value of a differnt field)?

    HI,
    You can set the default value to value of a different field. The only way is to use javascript like onFocus.
    Thanks,
    Sharmila

  • Can't Set Default Value for LOV Presentation DB Column

    I have a simple form. One of the fields is populated using a named, dynamic LOV with the following source query:
    SELECT USER_NAME DISPLAY_VALUE, USER_ID RETURN_VALUE
    FROM USER_ACCT
    ORDER BY 1
    I want the default user to be public, which is one of the possible values returned by the above query. However, I just can't find a good way to do this.
    If I put the following query in the Default section, nothing happens.
    SELECT USER_ID
    FROM USER_ACCT
    WHERE USER_NAME = 'PUBLIC'
    If I look up the ID and statically put the value in the Default, it works (This isn't acceptable . From environment to environment the value will differ)
    If I put the SQL in an after footer page process, it sets the value correctly in the session but, does not update the display.
    If I try to put it in the Post Calculation Computation section, it merely produces an error.
    I'm sure that I am missing something simple but, I have not spent an hour and half on this.
    Someone please help!
    -Joe

    A function I'd like to see is the ability to not only create a select list dynamically, but also set the default value of that select list's item to the first (or Nth?) value on that list. This could be specified in the builder by an item option.
    E.G., if a select list LOV returns three values: "foo", "bar", "baz", go ahead and set the value of the select list item to "foo".
    As far as I've been able to discover, there's no built-in way to do this in Application Express. I've looked through the app, the docs, and the forum. If such a method does exist, please let me know.
    Otherwise, we end up running additional processes that reissue the query so we can grab the first item as the default value. This seems inefficient to me.
    Keeping the LOV query and the "first item" query consistent can present problems as well. We usually end up pushing the LOV query into a function so it can be maintained in a single location, but this seems more like a workaround than anything else.
    While the query is probably cached, Application Express has that return value already, right? Why calculate/choose it again?

  • MASTER DETAIL - SET DEFAULT VALUES FOR ITEMS

    I have a master detail page where on the master I do things like updating the entered_by and entered_date fields
    by applying functions to set the item level details and the setting them to read only.
    On the detail portion of the page I'd like to do the same but I don't see the details items on the page - only the master items.
    The details portion is for comments so I'd like to have the commenter_name and commenter_date set to defined values
    when I hit the add row button on the details portion.
    Where are the detail items?
    I'm using APEX 3.2
    Thanks
    Steve

    Hi,
    When you use master detail form, APEX generate 'Detail portion' as report. So if you edit the page, you may not see actual items for 'detail portion'.
    If you want to set any default values or want to format these items, you may need to do as follows
    1> Edit 'report' of 'detail portion'
    2> Click on report attributes
    3> Click on column, you want to set default values
    4> Now here, Under 'Tabular Form Element' section you can do this by setting proper values to 'default type' and 'default' fields.
    Hope it helps
    Cheers
    Hari

  • Not null and enable or disable  column in tabular form

    Hi,
    Using apex version 4.1 and working on tabular form.
    ACT_COA_SEGMENT_MAS is Master table
    and
    ACT_SEGMENT_VALUES_MAS is detail table
    I have entered 8 rows in master table and PARENT_SEGMENT_ID is column in master table which is null able. If i specified PARENT_SEGMENT_ID with value in master table then in detail table there is column PARENT_ID that should not be null and enable.
    How i can enable or disable column when in master table PARENT_SEGMENT_ID column is null then in detail table PARENT_ID column should disable and vice versa.
    I have created tabular form on Detail table. before insert into the tabular form Check in master table in first entry if PARENT_SEGMENT_ID is not null in first row of master table then in tabular form PARENT_ID should enable and not null able in corresponding to this first row id's lines in tabular form.
    Same should check for second row in master table if PARENT_SEGMENT_ID is not null then entered rows with PARENT_ID into tabular form corresponding to 2nd id in master table should not nullable and column should enable in tabular form.
    Thanks & Regards
    Vedant
    Edited by: Vedant on Jan 9, 2013 9:12 PM

    Vedant,
    You need to create you own manual tabular form and not use the wizard.
    Using APEX_ITEM api you should be build you own form and you will be able to control how you wan to display the rows. (See Link [Apex Item Help|http://docs.oracle.com/cd/E37097_01/doc/doc.42/e35127/apex_item.htm#CACEEEJE] )
    select case when PRIMARY_TABLE_COLUMN is null then APEX_ITEM.DISPLAY_AND_SAVE(3 , DETAIL_COLUMN ) else APEX_ITEM.TEXT(2,detail_column) end "ALIAS" from detail table
    Hope that help.
    Vivek

Maybe you are looking for