Apex form based on a table problems with ID column

Hi all,
Am going round and round in circles trying to get this to work and i'm not getting anywhere fast.
Trying to get a form to process an single row insert into a table.
Using Automatic Row Processing to insert, the pk column page item is hidden and protected.
I would like to put the source of the PK (hidden and protected) item to be the next value of my sequence:
CREATE SEQUENCE   "MODULEFEEDBACKID_SEQ"  MINVALUE 1 MAXVALUE 99999 INCREMENT BY 1 START WITH 196 NOCACHE  NOORDER  NOCYCLE
/But I can't manage to get it to work.. every time i try to submit the page it just says "ORA-01400: cannot insert NULL into ( table )"
Any ideas?!
Thanks in advance
Ashleigh

when you create the form you said that the sequence is associated to pk? i think not
then you can create a trigger that set the pk and in the mru return the value of the pk to the item associated with the pk
or recreate the form with wizard and set the sequence to the pk there

Similar Messages

  • Can we create an APEX Form based on Table which has no Primary Key

    Hi,
    I have a requirement.
    I need to create a FORM based on a table having no Primary Key but it is having Unique Key . I can use Unique Key as an alternate of Primary Key.
    but When I tried to create a Form, I got the following message.
    Source tables for forms and tabular forms must have a primary key
    Thanks,
    Deepak

    Deepak_J wrote:
    Hi,
    I have a requirement.
    I need to create a FORM based on a table having no Primary Key but it is having Unique Key . I can use Unique Key as an alternate of Primary Key.
    but When I tried to create a Form, I got the following message.
    Source tables for forms and tabular forms must have a primary key
    Thanks,
    DeepakGood database design will always require a PK on the tables. There are only very few and rare expetions to this rule. One would be when you have store the data only temporarily in this table, like it is often done for import/loader tables. The data is first loaded in the "import"-table, then validated and then transported to the "real" tables. In such a scenario you can ignore the primary key on purpose. Because you already have a UK on this table it can't be such a scenario.
    For most other scenarios you should always add a PK. Ask critically why there is no PK on it. Is there a reason for it or was the table designer just not doing its job well?
    Btw: A UK is identical to a PK if the column is mandatory (NOT NULL). In this case you could simply change the constraint from UK to PK.

  • Detail tabular form based on two tables

    db11gxe , apex 4.0 , firefox 24 ,
    hi all ,
    i have a master detail form based on two tables , the detail form ofcourse based on one table , the problem is i want to include a column of another
    table into the tabular form , so i have changed the query of the tabular form and included the column in it correctly ,
    but the problem is about saving data , i can not save the data , i think
    because the "mru" process is based on one table , that is because i face an error talking about "mru" process when i try to save the data ,
    Error in mru internal routine: ORA-20001: no data found in tabular form Unable to process update.
    so
    what should i do to save the data ? should i create another "mru" process based on the other table or what ?
    thanks

    Anything beyond "simple" requires that you do it yourself.  I believe that what you want is "beyond simple"
    As far as I know, you can only use the 'mru' on one table.
    (I could be wrong)
    If the conditions are right, you might be able to simplify things such that you can use the 'mru'.
    ie CREATE VIEW on the two tables.
    However, you need to understand how Oracle treats DML operations on views, what type of views can be updated, etc., etc.
    If just creating the view doesn't work, creating an INSTEAD OF trigger on the view come to mind...
    (lol) - at that point, you have already started down the 'dark path' of creating your own 'MRU'
    personal note:  triggers have a really baaaddd habit of hiding code from other developers.  you are better off, in the long run, creating your own 'mru'..
    ie a package with procedures to handle INSERT, UPDATE, and DELETES
    MK

  • Dynamically change the value of a select list in form based on a table

    Hi Friends,
    I am using a form based on a table. I want to display two fields as select lists instead of text boxes and when a value
    in a select list is selected, the corresponding values will be listed in the next select list. For example if department
    value is selected in a select list the employees in that department will be listed in the employee select list. I saw a
    metthod using ajax for achieving this in tabular form in Denes's sample application[Click Here| http://apex.oracle.com/pls/otn/f?p=31517:176:462842537250908::NO] .
    Is there any way to achieve the same for a form based on a table,
    Thanks,
    Tj

    Hi Andy,
    Could you tell me how I could use your example with multiple Application Items?
    My page has 3 cascading select lists. The second is dependent on the first and the third is dependent on both the first and second. I thought I would just need to add the second application item as a get, but not sure what the syntax would be. I have troubleshooted to the point where my select list refreshes when I have one in the javascript...just not sure how to add the additional one?
    Here's what I have (I have been referencing your 'Get Employees' page)
    My Page Items:
    P0_VENDOR_ID
    P0_VENDOR_SITE_ID
    P0_INVENTORY_ITEM_ID
    My Application Items:
    F_VDR_ID
    F_VDR_SITE_ID
    My query in the application process has both F_VDR_SITE_ID and F_VDR_ID in it.
    My javascript function...this worked OK until I added the additional get.add('F_VDR_SITE_ID')
    function getItems(filter, listName)
    var xml = null;
    var list = document.getElementById(listName);
    var listvalue = list.value;
    var get = new htmldb_Get(null,$v('pFlowId'), 'APPLICATION_PROCESS=Set_Items',4);
    get.add('F_VDR_ID', filter.value);
    get.add('F_VDR_SITE_ID', filter.value);
    ret = get.get('XML');
    if(ret)
    var s = ret.getElementsByTagName("select");
    if(s){
    var o = ret.getElementsByTagName("option");
    var oCount = o.length;
    list.options.length = 0;
    for(var i = 0; i < oCount; i++){
    var l_Opt_Xml = o;
    appendToSelect(list, l_Opt_Xml.getAttribute('value'), l_Opt_Xml.firstChild.nodeValue);
    list.value = listvalue;
    if (list.selectedIndex == -1)
    list.selectedIndex = 0;
    get = null;
    Thanks,
    Janel

  • Need to build a form based on a table in a different schema

    Hello all,
    I am still new to APEX. I have been playing with it for a few days.
    I have an APEX user 'demo' whose default schema is demo1.
    But I need to create a form that can insert,update and delete based on table 'employee' in schema demo2.
    Demo has all the rights on employee table in demo2. I also assigned the demo2 schema to demo user's workspace.
    But when I am building the form, demo1 is th eparsing schema, but in table/view owner only demo1 is available. I don't see demo2 even though I assigned it to demo user's workspace.
    Is it possible to build a form based on a table in a different schema? I tried creating a synonym, but it doesn't show up in the list of tables to select from.
    I don't want to create views or anything because there are many tables in different schemas and it's not possible to go on creating views or such for each one.
    I was able to access th etable in a report though by prefixing the table name with the schema name.
    I would appreciate if someone could point me in the right direction.
    Thanks!

    Varad,
    Thank you for the explanation. So from what I understand, every time I create a form or report based on a table in a different schema, just change the parsing schema in application definition to the new one and create the form or report. So this way my forms and reports or whatever can be based on different tables in different schemas and they would run fine when deployed in a runtime environment (provided the appropriate privileges are there on the objects in context)?
    I tried this and I was able to see the different schema and select the table and create the form. I haven't tested in runtime though.
    Seems like a feasible option, need to test all scenarios though. If this is a feasible solution then there is no need to create synonyms or views (I am not talking about others' scenarios such as security etc) etc. Just appropriate privileges will do it.
    Thanks Varad. Have you used this way of creating a form in your apps? I need to explore more to see if it breaks anything.
    So, every time I need to select an object, say a table, in a different schema I need to temporarily change the parsing schema to that schema in the application definition? Is that a correct statement?
    I will leave the thread open to see if anybody has any comments.

  • How to add a new row in Tabular Form based on a table

    Hi
    I have tabular form based on a table.
    I want the table to have an empty row when there is no data
    in the table so that I can enter data directly.
    But right now whenever the page is launched, its showing a no data found message and I have to press the 'Add Row' button to enter data.
    Can anyone help me out on this?
    Thanks

    Hi Leo
    Your suggestion works fine in the APEX 2.1
    But in 3.0.1 it gives this error :
    Error in add row internal routine: ORA-01476: divisor is equal to zero
    Error Unable to add rows.
    I am not sure why this happens.

  • Exception Handling for a Form Based on a Table

    I created a form based on a table. If a user tries to enter a
    record with key data that matches an existing record, Oracle
    Portal creates a page and displays:
    Error:
    An unexpected error occurred: ORA-00001: unique constraint
    (TIMETRACK.SYS_C007185) violated (WWV-16016)
    How can I capture this exception so that I can display a
    friendlier error message (via a JavaScript alert or other
    means) instead of this page?
    Fran

    James, I tried your suggestion as follows:
    doInsert;--- This is the default handler
    Exception
    when DUP_VAL_ON_INDEX then
    p_session.set_value(
    p_block_name => "_block",
    p_attribute_name => '_STATUS',
    p_value => ' Time has already been entered for this project on
    this date. Click the Back button to return to the MIM Time
    Entry page. ');
    Raise;
    end;
    It did nothing. All I got was the default message.
    I then changed '_STATUS' to 'A_STATUS'. The resulting error
    message was: "Error: (WWV-00000)"
    ON A RELATED NOTE...
    I discovered while testing this form on IE 5 on a Mac, that
    additional error messages are generated. With IE 5 on WindowsNT
    only a message regarding the unique constraint is produced. On
    the Mac there is an additional message "No conversion performed
    for type INTEGER, value is NsNu (WWC-49102)"
    Anyone have any thoughts as to why the output of system
    generated errors should differ between a PC and a Mac?
    Fran

  • Open Form Based On A Table in same window

    Hi All,
    First to make things clearer I'll explain what I CAN do:
    Create a page which queries a session variable at the start and then
    depending on its value outputs different HTML, but always in the same
    format and more importantly the same window, to keep the look and feel etc...
    I have a link in a page which when clicked opens a form using wwa_app_module.link
    so it auto queries the form. This works fine.
    What I CAN NOT do is:
    The form was created using the "form based on a table wizard" and always opens
    in a new window.
    Can I make the form open in the same window that contains my wwa_app_module.link?
    Is this possible in a newer version that I have (I got Release 1)
    Any Suggestions?
    Cheers,
    Barry

    Firstly thanks Rahul Dubey for responding.
    What I mean by " contains my wwa_app_module.link? " :
    I have a form which contains a link similar to the one below:
    http://xxx.co.uk:8015/pls/pod130/PORTAL30.wwa_app_module.link?p_arg_names=_moduleid&p_arg_values=1389245486&p_arg_names=EMPNO&
    p_arg_values=7654&p_arg_names=_empno_cond&p_arg_values=%3D%3E
    When I click on this link it opens the form and runs a query automatically.
    The problem is I want to click on the link and have the form appear in the
    same window, not a new one.
    Cheers,
    Barry

  • Error creating form based on a table

    This is wierd. I am running WebDB2.2
    and up until now it has been no problem
    creating forms from tables. But now in
    this schema called SUMI I am unable to
    create a form based on a table. I get
    the error below. I have assigned SUMI
    almost every possible permission
    (DBA, WebDeveloper) so I
    don't think it is a permissions issue.
    Any ideas? Thanks in advance. Marvin.
    ---Error Message--
    14/Aug/2001:13:12:28
    ORA-06550: line 5, column 7:
    PLS-00302: component 'FORM_NOTWORK' must be declared
    ORA-06550: line 5, column 2:
    PL/SQL: Statement ignored
    ORA-06550: line 5, column 7:
    PLS-00302: component 'FORM_NOTWORK' must be declared
    ORA-06550: line 5, column 2:
    PL/SQL: Statement ignored
    VARIABLES IN FORM NOT IN PROCEDURE:
    NON-DEFAULT VARIABLES IN PROCEDURE NOT IN FORM:
    null

    I am bumping this up. Can anybody help or
    at least point me in the right direction?
    Thanks!

  • Can Shuttles be based non-base  table ViewObjects with transient attributes

    Hello,
    Users have to select records from a data collection and a Shuttle looks most appropriate/nice for this purpose. We can introduce technical intersection tables in order to generate the Shuttles with JHeadstart 10g R3 if necessary, but there is no “functional” need to update any data in the database and therefore it would be practical if the ‘right’ side from a Shuttle can be based non-base table ViewObjects with transient attributes only. So, our interested is to know which records have been selected, i.e. moved to the right side from the Shuttle.
    Hope that my question is clear enough.
    Greetings,
    Michael

    Michael,
    This cannot be generated out-of-the-box.
    It is easiest to add the shuttle post-generation to your page, and then create a custom template to generate your custom shuttle into the page. I suggest you take a look at an example of a generated shuttle in a page, and the JHeadstart IntersectionShuttleBean class. You will see that the value property of <af:selectManyShuttle> points to the selectedKeys method in the JHeadstart Shuttle bean. In your case, you can create your own managed bean and bind the value property to your own method which will provide you access to the selected rows. The value property of the selectItem within the af:selectManyShuttle determines the property that is used to identify the selected row (which is the row key in case of Jhs-generated shuttles).
    Steven Davelaar,
    JHeadstart Team.

  • Delete button on Form based on a table

    I created a form based on a table. For the delete button, how can I make it ask before deleting the record? ie, when the user hits Delete, a question comes up that asks: Do you really want to delete this record? The user then hits Yes or No.
    Please be specific, I'm new to Portal. Thanks for any help.

    1. Edit your Form and go to "Step 4 of 7, Formatting and Validation Options" section of the builder.
    2. In the left frame, click on DELETE_TOP and/or DELETE_BOTTOM link.
    3. In the right frame, you should see a section (i.e. "Javascript Event Handlers") where you can add your own javascript code. Click on the onClick event.
    4. In the adjacent free-text field, add the following code:
    javascript:if(confirm('Do you really want to delete this record?')){
    null;
    else
    window.stop();
    5. Click on OK to compile. That's it.
    The window.stop() is needed to prevent the PL/SQL event handler (i.e. Update) from running. Without window.stop(), if the user presses Cancel, the form will perform an update anyway. You'll need to remember that the Form will by default perform the Javascript handlers first, then the PL/SQL handler.

  • Problem with checkbox column in matrix

    Hello.
    I have a little problem with checkbox column in matrix.
    Column is binded to the UserData.
    It has ValOn="Y", ValOff="N".
    I use C++. It is wird problem. In matrix I have 10 columns - scrollbar role and if You want see checkbox column, You must role to the right. If this column is on the screen, and I use:
    checkcell->PutChecked(VARIANT_TRUE);
    then the checkbox is cheched, and if the checkbox isn`t on the screen and I use this comment - it nothing happening.
    I tried to use ValOn="Y", PutChecked...
    The problem i solved if the column is on the screen - if the column is first in matrix or second, but if it`s last I have a big problem.
    My column with checkbox is not editable, but I tried to make it editable, check it, and then make it uneditable - the same efect.
    How can I solve it ?
    Sorry for my english.
    Kamil Wydra

    Hello Kamil,
    I am not sure about your problem, but here is an example of how to use checkbox in UI API.
    First, create the matrix with checkbox column in Screen painter, and the output is an xml file, like this. Type as 121 indicates that it is a check box.
    - <column AffectsFormMode="0" backcolor="-1" description="" disp_desc="0" editable="0" right_just="0" title="Rented" type="121" uid="Rented" val_off="N" val_on="Y" visible="1" width="41">
      <databind alias="U_RENTED" databound="1" table="@VIDS" />
      <ExtendedObject />
    Second, bind the column to table from DB. This is a bug of 2004 Screen Painter, so if you are using 2005 Screen Painter, there is no problem.
    Third, when you open the form, you can check and uncheck the cell.
    BTW, please set the editable of the column to true.
    Hope this helps,
    Nick

  • WebRowSet Problem  with database columns defined as TEXT??

    Hello,
    Can somebody help me on this subject. (http://forum.java.sun.com/thread.jspa?forumID=31&threadID=778586)
    I have the same problem with TEXT column when I try to populate the WebRowset.
    Thanks,
    Stephane

    OK,
    I change my postgresql driver for the lastest version (postgresql-8.2-506.jdbc3.jar) for JVM 1.5 and it's find...
    This driver support the javax.sql.
    St�phane
    Edited by: Borealis on Oct 15, 2007 12:43 PM

  • Problem opening Form based PDF via Safari browser with Adobe Reader 9.3 on MAC

    Hi,
    I'm mentioning below the problem that we are facing when we open a form based PDF created using a licensed version of Adobe Livecycle Designer ES (Version 8.2.1.4029.1.523496) on a MAC machine through a Safari Browser.
    We tested this PDF form on a windows machine and the PDF opens in an IE browser via the latest Adobe reader 9.3 without any problem. I then received complaints by our clients that they were unable to open the same PDF on their Safari browser on a MAC machine, I tried to resolve the problem by downloading the latest version of Adobe Reader 9.3 for MAC but noticed that the Safari browser window would just keep refreshing the page without displaying the PDF at all. I then uninstalled the Adobe Reader 9.3 version and downloaded and installed an older version i.e., Abobe Reader 8.2 version for MAC and noticed that the PDF document successfully opened in the Safari browser. My question is why does a form based PDF work with an older version of Adobe Reader for MAC and not with the latest version? Our clients are not comfortable with the fact that we are refraining them from upgrading to the latest version of Adobe Reader for MAC and that they would have to downgrade their existing Adobe Reader 9.3 to a lower version Adobe Reader 8.2 in order for the PDF forms to work when it should be the other way around.
    Is there any fix or a patch that is currently being worked on that would resolve this issue in the latest Adobe Reader for MAC? If yes then when would it be ready? This issue is quite critical for our business and would appreciate it if this would be looked into with high priority.
    Thanks and Regards,
    Sheikh Huraiz Ahmed.

    That suggestion makes sense and likely works, but only if the user is on a machine that will allow them to use Reader. I'm sending this out to a lot of teachers, who are using machines either at school, or are school-issued machines, and they don't have the admin privileges to install software-- even Reader.
    so my problem is, if they are stuck on a machine without Reader, and without the possibility of having Reader... it's just not going to work because Preview can't handle these functions.
    And, since that is not an acceptable answer with what I'm trying to do... I will find another way to create/submit forms. I think there are some online possibilities I will have to make work.
    very, very disappointing and frustrating.
    Kristi

  • How to create Form based on a table to display multiple record

    Hello All,
    Would somebody please tell me how to create a Form based on a single table ,
    to view and insert multi record based on a single table.In other words I would like
    to have a form as shown below ,where the users can Insert,update,delete,query and so on
    Item Id PArt Number List Price
    100 Item-1 $120.oo
    200 Item-2 $150.00
    300 Item-3 $50.00
    I know I can do it as Single Record block using Tabular Format,but multiple record ?????
    Thanks in Anticipation
    Babu

    Try this method,
    1. Creat a Master Detail Form (Custom Layout and not tabular)
    and in the master block select one field.
    2. In the HTML layout for master remove the reference for
    that field(so that nothing will appear in the master block
    of the form).
    3. Before the update (in the Pl/SQL event handler select the 'Save' event and write the following code to avoid updating master block).
    p_session.set_value(p_block_name => 'MASTER_BLOCK',
    p_attribute_name => 'MASTER_ACTION',
    p_value => 'None');
    doSave;
    For eg, let's say
    Master is from 'Dept' table and Detail is from 'Emp' table(with join condition Dept.dept_id = Emp.dept_id). In the master remove everything except dept_id field and in the HTML layout for master remove the reference of the dept_id field(you cannot remove this field physically from the master layout). Now the form will look like multirow form rather than master detail form but only problem with this workaround is 'Detail Action' will be present in the detail block.
    I hope this will help you.
    Thanks
    -Krishnamurthy

Maybe you are looking for