Inserting manually in a form

Lets say I have to insert a new record into a TESTTABLE manually when user presses a button.
I put the code in when-button-press trigger
/code
insert into table..values...
set_record_property(1,block, status_changed); -- mark the block as changed
/code
It work except that when a user close the form/window , form ask the user to save changes yes/no.
The problem is evenif user select 'no', the form is still inserting the record into testtable.
any idea why is this happening, how to prevent it. I do not want to insert if user select no.
Thx

The moment you execute the INSERT statement the records will be inserted into the table but they are not committed until you issue a COMMIT_FORM or press "Save", even if the user chooses "No" in the dialog box, your insert statement was an explicit statement, the form is not aware of the insert, that's why it cannot roll back.
If you want to rollback, you need to customize some triggers, create a savepoint before you insert the records and use a ROLLBACK statement in in your POST-FORM trigger.
Unfortunately I don't have Forms installed on my current machine to test, but it should work.
Try it, It's Fun.
Tony
Edited by: Tony Garabedian on Oct 4, 2008 2:35 PM

Similar Messages

  • Insert Rows Above in Form

    Hello all,
    I'm trying to allow users to insert rows on a form in such away that the added row renders in the middle of the form. Probably having a check box on each row saying 'insert row above'.
    The purpose is to emulate editing a table in a word processor basically. I understand I'd have to manage re-sequencing the data as the user changes records that appear in the 'middle' of the table.
    I've seen D Kubicek's 'row mover' page and it's a good fallback, however I'd be interested as to whether what I want is really simple or will involve a lot of js and / or Ajax.
    Cheers,
    Toby
    ================================================
    Eg
    Before
    Sequence Data Chkbox ("insert above")
    ======================
    ID1 Value1 []
    ID2 Value2 []
    ID3 Value3 [x]
    After
    Sequence Data Chkbox
    ======================
    ID1 Value1 []
    ID2 Value2 []
    (null) (null) []
    ID3 Value3 []

    See this example on that issue if your tabular form is standard:
    http://apex.oracle.com/pls/otn/f?p=31517:209
    This example again, if it is a manual one:
    http://apex.oracle.com/pls/otn/f?p=31517:170
    As Andy suggested, the order in the SQL, nulls first would do the job. However, if sorting is enabled, there is a problem.
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://apex.oracle.com/pls/otn/f?p=31517:1
    -------------------------------------------------------------------

  • Help with validation on a manually created tabbed form

    version 4.1.1.00.23
    Hello,
    I have a manually created tabbed form that I'm having trouble creating validation on.
    The page is a Resource Staffing page where PM's can forecast the Resources that will be needed for various projects. The forecast can be for 12 - 18 months.
    The requirement is to display a message to the user if they are trying to save a row without forecasting any time. It's possible they may not know how may Resources or the length of time needed when the row is created.  If they respond that they want to save the row without time the MRU will create the record. If they answer that they do not want to save the row they are returned to the page without loss of information.
    The month fields on the page are defaulting to 0 (zero).
    I've updated the Save button to Redirect to URL and in the URL Redirect I have: javascript:confirmNoTimeSaved()
    The javascript:
    [code]
    function confirmNoTimeSaved()
        var arr_jan,arr_feb,arr_mar,arr_apr,arr_may,arr_jun,arr_jul,arr_aug,arr_sep,arr_oct,arr_nov,arr_dec = new Array();
            arr_jan = document.wwv_flow.f07;
            arr_feb = document.wwv_flow.f08;
            arr_mar = document.wwv_flow.f09;
            arr_apr = document.wwv_flow.f10;
            arr_may = document.wwv_flow.f11;
            arr_jun = document.wwv_flow.f12;
            arr_jul = document.wwv_flow.f13;
            arr_aug = document.wwv_flow.f14;
            arr_sep = document.wwv_flow.f15;
            arr_oct = document.wwv_flow.f16;
            arr_nov = document.wwv_flow.f17;
            arr_dec = document.wwv_flow.f18;
        for(i = 0; i < arr_jan.length; i++)
            if(arr_jan[i].value == 0 && arr_feb[i].value == 0 && arr_mar[i].value == 0
                && arr_apr[i].value == 0 && arr_may[i].value == 0 && arr_jun[i].value == 0
                && arr_jul[i].value == 0 && arr_aug[i].value == 0 && arr_sep[i].value == 0
                && arr_oct[i].value == 0 && arr_nov[i].value == 0 && arr_dec[i].value == 0)
                txt = 'You have no time assigned to your Forecast. Do you want to save this Forecast without time entered?' + '\n' + '\n' + '"Yes" to save the Forecast.' + '\n' + '"No" to return with no changes.';
                caption = 'Confirm Saving With No Time';
                vbMsg(txt,caption)
                switch (isChoice)
                    case 6:
                        doSubmit('SUBMIT');
                        break;
                    case 7:
                        doSubmit('CANCEL2');
                        break;
            else
                doSubmit('SUBMIT');   
                break;
    </script>
    <script language="VBScript">
    <!--
    //Yes    = 6
    //No     = 7
        Function vbMsg(isTxt,isCaption)
            testVal = MsgBox(isTxt,vbYesNo,isCaption)
            isChoice = testVal
        End Function
    //-->
    </script>
    [/code]
    The 'CANCEL2' is just a Branch I'm using to branch back to the page without clearing Cache. I do have 'Cancel' button on the page and the Branch created for that clears the Cache.
    While debugging the javascript I get into the VB Script on the testVal = MsgBox(isTxt,vbYesNo,isCaption) line and the browser crashes.
    Can someone help with this requirement?
    What additional information can I provide?
    Thanks,
    Joe

    The code above is my attempt at this requirement, however, the browser crashes when it gets to the VBScript on the MsgBox call. I don't have to use this approach. Does someone have an idea how to solve this?
    Thanks,
    Joe

  • Select list in a manually created tabular form

    I created a select drop down item in a manually created tabular form. When I run the page, it also shows the null value '%'. How do I edit this?
    This is the line I am using in the SQL:
    htmldb_item.select_list_from_query(34,IN_PGRS_STAT_DSC,'select distinct STAT_DSC, STAT_DSC from PROJECT_STATUS_REF') IN_PGRS_STAT_DSC,

    And the select list doesn't work. It gives me an error message if I have the form to display one extra empty record and the select list. But even with the select list, if I don't include the extra row, it works properly.
    report error:
    ORA-06550: line 1, column 13:
    PLS-00103: Encountered the symbol "COLLECT" when expecting one of the following:
    := . ( @ % ;
    ORA-06550: line 1, column 82:
    PLS-00103: Encountered the symbol ";" when expecting one of the following:
    . ( , % from
    What I also realized is that the drop down shows the value 7. But the table is empty with no records. I have no idea where this number 7 is coming from?
    Message was edited by:
    user494578
    Message was edited by:
    user494578

  • Insert not working in forms 6i

    Hi
    I have a non database block in forms 6i and have the values written into the database using insert statement.
    I have a situation where only for a couple parent records, i am not able to insert child records using forms.
    I am able to insert through backend.
    any ideas.
    thanks,
    Edited by: 699704 on Sep 22, 2011 12:49 PM
    Edited by: 699704 on Sep 27, 2011 7:52 AM

    What error do you get?
    If you get no error, check if you have proper error handling, not something like "when others than null", or an on-error trigger that doesn't show you the error.

  • 2 manually created tabular form on the same page based on 2 different table

    Hi, I followed the how to document on manually creating tabular form, including one extra row.
    The first form I created works fine, but when I attempt to create the second tabular form based on a different table on the same page, I get the following error message when I try to create the query:
    ORA-04045: errors during recompilation/revalidation of PUBLIC.X ORA-00980: synonym translation is no longer valid
    The logic behind both tabular forms I am using is the same, except that for the second query, I use 100 instead of 1, 300 instead of 3, etc:
    select htmldb_item.hidden(1,empno) empno,
    ename,
    htmldb_item.select_list_from_query(3,job,'select distinct job, job from emp') job,
    htmldb_item.popupkey_from_query(4,mgr,'select ename, empno from emp',10) mgr,
    wwv_flow_item.date_popup(6,null,hiredate) hiredate,
    htmldb_item.text(7,sal,10) sal,
    htmldb_item.text(8,comm,10) comm,
    htmldb_item.select_list_from_query(9,deptno,'select dname, deptno from dept') deptno
    from emp
    Can anybody help?
    Thanks a lot

    Hi,
    If by "100 instead of 1" you mean the column numbers, then this won't work as you can only have a maximum of 50.
    Andy

  • Inserting data from jsp form to multiple tables !

    Hi,
    I want to insert data from jsp form to two tables
    tables are
    (1) Form
    formId (PK)
    deptName
    (2) Data
    formId (FK)
    sNo
    description
    itemCode
    and the problem is that i want to save information form a jsp form to above two tables and i have only one form.
    so how do i insert data from a jsp form to multiple tables.

    You already know what your form in the jsp will be and what fields they are. You also already know what your database looks like. Using one form, you should be able to break the data down, and give it certain ids and/or names, so that when the form is submitted, you retrieve the correct values corresponding to a specific field and insert it.
    Unless there is something else I am not catching, this seems pretty straight forward.

  • Manually download Pro forma invoice

    Hi All,
    Can you help me out with these question.
    1, How to manually download Pro forma invoice by one time for one days shipment.
    2, Do you have other manual for download shipping slip PDF?
    Thanks

    Thank you very much for kind reply
    First Question is done, it working now.
    Can you please assist me in second question.
    >>>>> " How to download shipping slip as PDF "

  • Can it be possible that a user insert data by a form and then create a PFD?

    Can it be possible that a user insert data by a form, then store the data in the Data Base and finally create a PFD?
    If this is possible with BI Publisher, what do i have to do to link the form with the BIPublisher interface?
    Regards

    Hi
    If you just have a PDF form and do not need to pre populate data then all you need do is:
    1. Add a submit button to the PDF - you can use the full Adobe product or a BIP API
    2. Load the PDF as a template with a dummy data source.
    The user can then run the "report" as usual. When they have completed the form they can hit the Sumit button on the form. Adobe will then scrape the data out of the form in an XML format and post it to the URL you added. At the other end of the URL you need a servlet to accept and process the XML data.
    If you need to prepopulate the form you can attach a datasource to the PDF template but ensure the fields are preserved after running the form for the user through the config options.
    BIP does have APIs to populate drop lists, etc but these are not exposed thru through the BIP UI.
    I'll try and write this up for the blog and OTN soon
    Regards
    Tim

  • Not able insert ,query data from forms

    hi,
    I am not able to insert data or query data from forms(10g devsuite).getting error frm-40505,frm 40508 .i am able to insert and select record from sql plus.the block ihave created is control block .it is connected to the table using the properties.
    should i do anything to insert record.please help

    the block ihave created is control block .it is connected to the table using the properties.A Control Block, by definition, is a non-database block. This means the block is not directly connected to a table so you have to manually display data in the block and any DML you want to perform on data in this block you must do manually as well.
    There are four database objects you can base your database block on; 1) a Table, 2) a View, 3) From Clause Query (basically an In-line View), and 4) a database stored procedure. I recommend you use one of these four methods rather than manually display your data.
    Craig...

  • Problem with Insert process in Master Forms?

    Hi Patrick,
    It will be very greatful to me if you can help me out why insert is not working in case of forms as explained below
    I have created a tabular form where i am able to update & delete and adding rows with out any problem.
    When i am trying a insert a new record it is throwing the below error...
    Error in mru internal routine: ORA-20001: Error in MRU: row= 1, ORA-20001: ORA-20001: Current version of data in database has changed since user initiated update process. current checksum = "D47F24D590E442A8BCF98D5BA7D782AC", item checksum = "B3FF449D4A98A3313839C25D15586A17"., update "APEX_DEMO_SCHEME"."DEPT" set "DEPTNO" = :b1, "DNAME" = :b2, "LOC" = :b3
    Thanks,
    Anoo..
    Edited by: Anoo on Jul 20, 2010 3:37 AM
    Edited by: Anoo on Jul 20, 2010 3:38 AM

    If I were you, I would never do this through any program. The only secure, reliable way is to rewrite everything by your own hands. Even if we could argue, your way works as well (and could be faster at the beginning), at the firt moment you will be asked to perform any tiny change in this "imported" thing, you will cry your eyes out (and understand why it is the only useful way to rewrite everything manually).
    regards Otto

  • Manually created tabular form

    I created a tabular form manually. I got it to work so that it displays a blank record automatically so the user can insert a new row. But this only gives the user to insert one row at a time. Can this be changed so the user can insert multiple rows at a time?

    Thanks. The tabular form (detail) is actually part of another form based on another table (parent).
    I want to use the apply changes button that the parent form provides to update recrods for the detail form. And for my requirement, I actually need only 3 extra rows, and this is set number for every parent record.
    Can this be done without having to click on add row button, since I only and always need 3 rows?
    Thanks

  • Help please !!  Need to insert date automatically in form

    I have been trying unsuccessfully for a week to automatically
    capture today's date on a form. I can display a date on screen but
    it will not insert date into mySQL db. All other information is
    inserted as expected.
    Am I just whistling in dark? Is there no way to eliminate
    user input for the order date field?
    I have looked throughout the forums and no luck.
    Anyone have any ideas about how to do?
    Thanks,
    Dale :-)

    You can use a timestamp function within your MySQL table, but
    remember you can only use the timestamp function ONCE in a table.
    Using the timestamp Function:
    Set the field type to TIMESTAMP. You can also set the default
    to CURRENT_TIMESTAMP and the attributes to ON UPDATE
    CURRENT_TIMESTAMP if you want the timestamp to change when the
    record is updated.
    If you want to record times more than the one time you are
    using the timestamp and you are using PHP/MySQL or PHP/MySQL ADODB
    (InterAKT's PhAKT Extension), then try this:
    http://chuckomalley.net/help/insert_date_help.php
    That gets the time into the MySQL Database. Next thing you'll
    want to do is to have it display the time the way you want it. The
    default will display it as yyyy-mm-dd hh:mm:ss and you may not want
    it that way. To display it the way you want it try this:
    http://chuckomalley.net/help/display_formatted_date.php
    For the specific syntax on using this, refer to the online
    MySQL Manual and search for DATE_FORMAT() at
    http://dev.mysql.com/doc/mysql/en/index.html
    Cheers
    Chuck

  • PHP, INSERT FILNAME FIELD  FROM FORM

    I am trying to do a simple insert record into a MySQL
    database and for the life of me I cannot get the file field
    (<input name="photoNAME" type="file" id="photoNAME"
    />)
    to insert into the database. I have three other fields that
    do insert correctly the only one that won't go in is that field. I
    can't even get the form field to echo to the screen.
    Anyone have any idea why?
    Thanks

    Gary White wrote:
    > On Wed, 21 Feb 2007 13:49:43 +0000 (UTC), "VernMan"
    > <[email protected]> wrote:
    >
    >> (<input name="photoNAME" type="file"
    id="photoNAME" />)
    > See
    http://www.php.net/manual/en/features.file-upload.php
    As Gary indicates, using type="file" is for file uploads. If
    all you're
    trying to do is get the name of the file into a database,
    there's no
    need to upload the file. In fact, it's a total waste of
    resources.
    You need to use the PHP file system functions to build a list
    of the
    images in your folder, and use it to populate a drop-down
    menu of
    filenames. I show how to do it in both "Foundation PHP for
    Dreamweaver
    8" and "PHP Solutions", but it's not all that difficult to
    code yourself
    if you use scandir() (PHP 5 only).
    David Powers, Adobe Community Expert
    Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
    Author, "PHP Solutions" (friends of ED)
    http://foundationphp.com/

  • Insert a Photo into form?

    1. We're deciding which version of Adobe to buy...
    We have a form that applicants are required to fill out.
    I have successfully created this form using Acrobat 9 Pro (trial version on Windows Vista).
    Are we able to insert a photo of the applicant onto the form?
    And if so, how do I do it?  I need to demonstrate that this works to our board before a purchase is made.
    So far I've only done a 'workaround solution' which is to create a button, icon only and insert photo.
    Is there a better way?
    And my last question....
    2.  Which version to buy?  What we need it to do is:
    a. send out the form by email to 22 people per week
    b. have applicants complete several highlighted fields & return the form by email to us along with a photo
    c. we insert their photo on 3 pages if they haven't already done it
    d. we print it out
    e..when the applicant arrives for their exam, they are given their exam.  They check off some boxes manually with a pen
    f.  we scan the completed 2 sided form into our computer for storage and retrieval
    Do we need Standard or Pro ?
    Thank you very much

    hi!
    i just read through the thread but couldn't really follow due to my lack of knowledge of acrobat.
    even if i don't know how it seems to be possible to generate a pdf which can be used to attach photos to it with a acrobat reader or any other pdf reader.
    it would be great if anyone could explain a bit more in detail how to do this.
    my question was if it is also possible to attach any other file to the pdf?
    i am a dentist specialising in implantology but unfortunately there is no software which meets the needs for implantologists regarding an exam and diagnosis. everything has to be typed manually in a practice management software which is very expensive and will not be installed on my laptop as i visit the practice just once a week (license too expensive and not useable anyway because server client software).
    i would now like to make a .pdf that i can run on every computer with a acrobat reader which alows me to enter everthing i find during my exam.
    it would be absolutely awesome if i could also attach clinical photographs, xrays and 3d scan data. there is no need for acrobat to be able to display these data. it just needs to store them in the pdf so i could make the pdf attach al the files and just import it in the software in each practice for each patient.
    thanks for the help!

Maybe you are looking for

  • Crs installation problem in oracle 10g rac with NAS storage

    Hi, for my practice i am trying to install oracle 10gR2 on RHEL5-64bit OS in my laptop. during my crs installation i have struckup with the below error while i am executing root.sh in node1. Error: +++++ Setting the permissions on OCR backup director

  • Change Editable ALV to Un Editable

    HI, I need to change the Editable fields of my ALV into non Editable based on a User Action . My Scenario goes as follows. I have four Fields in My internal Table. A B C D. Only Field C is Editable  when the first time ALV is displayed for the record

  • Please help...viruses prevent me from recovering my laptop and to use virtus removal

    I am trying to restore my laptop to factory settings with saving my folders. My laptop has a webstroids virus is the reason for me doing this. When the factory image recovery was finished or about finished this message pops up..... Restore7.exe-Appli

  • MuVo TX SE 1GB formatting prob

    I've been reading a lot of questions and answers, but I still couldn't find my question, so I post it here... I have a problem with my MP3 Player. I have a <I>MuVo TX SE</I> from <I>Creative</I>. (GB) I can not format my MP3 Player anymore. I can sta

  • Select the multiple nodes in a tree

    Hi Experts, We need to select the multiple nodes in a tree.Whatever we are selecting,that has to be added in the table as a tree structure itself. For ex: A |--A1     |--B1 If We select the A then A,A1 and B1 has to be added in a table.Please help me