Copying master detail records in oracle forms

Hi,
Have a master details block , using a copy button i copy the existing contents
in both the blocks , than primary key and foreign key value of the both blocks are changed and i want to save it as a new record.
Problem is when i do the above it goes to record status as update
it is not doing insert with the values.and throwing an error wrt referential integrity
pls help
with thanks

This forum focuses on EBS. For Form specific questions, you can try Forms

Similar Messages

  • Using EJB creating Master/Detail Record

    Hi All
    I would really in need of your help regarding how to show the information of master detail records in a single form
    eg: one text field with department Id and a Search button which should give relevent employees details working in that particular department.
    I tried with ADF business components it works fine..
    I need to do through pure Session Beans and Entity Beans(note : not thru using EJB:UseBean Tag)
    Please i will really appreciate your valuable help..
    Thanks All
    Have a Nice day
    Mohamed Anez

    Kunal:
    Use a code snippet like the following:
    --- Assuming you're in the detail EO's create method ---
    oracle.jbo.server.EntityDefImpl eDef = oracle.jbo.server.EntityDefImpl.findDefObject(<package-qualified-name-of-the-master-Entity-Object>);
    oracle.jbo.Row masterRow = eDef.findByPrimaryKey(this.getDBTransaction(), <foreign-key>);
    If the row does not exist, masterRow will be null.
    findByPrimaryKey first checks the entity cache (which will include your new master row(s)) and then go out to database (if it's not in cache).
    Thanks.
    Sung

  • Master-Details Record

    I have a Master and two details records. I need to generate report for the Master-Details record.
    I need to include some details from the Master table and some details from each of the detail tables.
    For example :
    In Master table: Employee_Number
    Employee_Name
    Company_Code
    Company_Name
    In Application Detail table: Application_Code
    Application_Name
    In Non-Application Details table: Non-Application_Code
    Non-Application_Name
    I need to include Employee_Name, Company_Name, Application_Name and Non-Application_Name in my report. How should I go about creating the report?and may I know what type of report style should I use?Should I use Tabular or Group Above?
    Thank for your help

    hello,
    you might want to start off with a regular master detail layout and then modify the layout manually to fit your needs.
    when running throught he wizard, you just select whichever fields you want to display.
    regards,
    the oracle reports team --pw                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Foreign key validation while creating master/detail record in document mode

    I am creating master/detail records in the document mode. And I am generating the master primary key in the create() method of the master Entity Object. Now I valdate the foreign key in the detail Entity Object's validateEntity() method by doing a query to the master table through some View Object.
    But since the master record has not yet been posted (since it hasn't been committed) to the database, this query does not return any record and the validation fails in detail object.
    And thus the create fails.
    Please let me know if this is the right approach for doing this. If so where I am going wrong? Else please let me know if there are any better approach to do this.
    Kunal

    Kunal:
    Use a code snippet like the following:
    --- Assuming you're in the detail EO's create method ---
    oracle.jbo.server.EntityDefImpl eDef = oracle.jbo.server.EntityDefImpl.findDefObject(<package-qualified-name-of-the-master-Entity-Object>);
    oracle.jbo.Row masterRow = eDef.findByPrimaryKey(this.getDBTransaction(), <foreign-key>);
    If the row does not exist, masterRow will be null.
    findByPrimaryKey first checks the entity cache (which will include your new master row(s)) and then go out to database (if it's not in cache).
    Thanks.
    Sung

  • Generate file with a master-detail records

    Hi everyone,
    I need your help, one more time.
    I want to generate a file in ODI that have two distincts records of the detail, a master-detail records. The first one record contain general data and second one contains a second level information about the previous.
    I got the result using a bad solution, loading the file line by line, but the file is so large and performace was very slow.
    The expected result is:
    001Purchase Order id 99
    002Item 1
    002Item 2
    001Purchase Order id 150
    002Item 1
    002Item 3
    001Purchase Order id 4870
    002Item 3
    Anyone has an alternative for that?
    regards.

    hello
    i belive you need to use pivot operator
    check out this blog
    https://blogs.oracle.com/warehousebuilder/entry/pivoting_data_in_owb
    rgds

  • What is the proper way to record line numbers in Master/Detail records?

    Guys and Gals,
    Been thinking about this for awhile, but thought it best to ask the people who really know what they are doing.
    What is the proper way to record & show line numbers in a Master / Detail record set?
    For example, take Master/Detail relationship Orders and OrderItems. Orders has a column Document_Number and OrderItems has Document_Number, Line_Number. Line_Number should contain the row number 1,2,3,4 ... etc. for each row in a document.
    Should I ...
    <ol><li>Add a sequence and a trigger in the database? The FusionOrderDemo does this, but then the sequence never "resets" and I've got row numbers that keep incrementing. So one document has rows 4,5,6 and the next document has 7,8,9 when they should both have 1,2,3.</li>
    <li>Programmatically take care of the row numbers? This seems like I'm asking for trouble. Anytime an insert or delete operation gets done, I'll have to iterate through rows and re-assign row numbers.</li>
    <li>Is there a way to assign row numbers in a table iterator (or data collection?) to an entity?</li></ol>
    Any suggestions would be appreciated. It's looking like #2 is my only option, but if anyone knows different I'd love the input.
    Will

    Thank you both guys.
    As John said, I believe I'm looking for a gap-free sequence per master record.
    The line number of the OrderItems table is the second half of the primary key. The first half of the primary key (DocumentNumber) is the foreign key to the Orders table.
    Think of it like line items on an order or invoice. For example, if you were talking to someone on the phone concerning an invoice, you might say, "The pricing for line item #3 is incorrect." In this case, it's good to have a common reference. Or imagine a Microsoft Excel spreadsheet with no row numbers displayed! You'd never get anywhere if you had to explain something over the phone.
    If this is tricky to perform, I take it using a sequence and trigger such as the Fusion Order Demo is the best way to approach the challenge for simplicity's sake?
    Will

  • Triger for display next record in oracle forms

    hai all,
    i want to do
    when new form opened i have to add new reord that is empty new form also my new rownum will be displayed.
    now i getting first record.
    like:
    GROUP_ROWNUM:     1
    GROUP_ID:      120130
    GROUP_NAME aaaaaaaaa
    need like:
    GROUP_ROWNUM:     7
    GROUP_ID:
    GROUP_NAME
    that can be done by
    trigger for display next record in oracle forms?
    or through property seting?
    thanks in adv,
    rcs
    --------

    YES, this block is base on the DB table
    through defualt navigational button i can go to next,last,new record
    but i want create seperate form for new entry, in that i want to display
    old rownum
    formula to get rownum automatically (i am not at all typing it is system generated)
    even though i created column group_rownum for rownum
    (i can't be typing)
    LAST_RECORD;
    NEXT_RECORD; also not getting the next rownum
    i hope now understand me
    any posible way?
    thank you for your good input
    i.e.
    SQL> DESC GROUP_MSTR1;
    Name Null? Type
    GROUP_ID NOT NULL NUMBER(10)
    GROUP_NAME NOT NULL VARCHAR2(30)
    SQL> select * from GROUP_MSTR1;
    GROUP_ID GROUP_NAME
    123 AAAAAA
    124 BBBBBBBB
    125 CCCCCCCCC
    126 DDDDDDDD
    1 eeeeeeee
    2 FFFFFFFFF
    3 ggggggg
    7 rows selected.
    SQL> select rownum, GROUP_ID, GROUP_NAME from GROUP_MSTR1;
    ROWNUM GROUP_ID GROUP_NAME
    1 123 AAAAAA
    2 124 BBBBBBBB
    3 125 CCCCCCCCC
    4 126 DDDDDDDD
    5 1 eeeeeeee
    6 2 FFFFFFFFF
    7 3 ggggggg
    7 rows selected.
    -------------

  • Master-details records

    Hi Everybody,
    i have a requirement to show master detail records.to show data i have 3 tables
    they are 1) Flat_Master(flat_id,flat_desc,pic)
    2)Flat_Detail(flat_id,flat_face_id,flat_loc)
    3)face_tab(face_id,face_desc)
    in my jsf page i displayed flat_master as master records and flat_detail as detail records
    here flat_detail is updatable.so for flat_face_id i created a lov choice list based on face_tab table(ADF BC level).
    so when master record i changed, my choice list is not getting changed amd even when page load also for the first record also it is not selecting..
    How can i set this choice list value programatically based on master records?
    Any ideas can you please share with me?
    thanks
    KM.
    Edited by: Mr. Murali on Sep 13, 2011 3:21 AM

    pls provide me the detailed view.,
    what ur trying to say and wat s ur use case?

  • Connect from master/detail to the oracle workflow diagram viewer possible?

    Hello we are using apex 4 and we have a master/detail form.
    Now we want if you click on the detail on item_key or item_type to redirect to the corresponding diagram in oracle workflow.
    Is this possible if so could you point us in the right direction.
    Thank you.

    Hi Frank,
    Thanks for your reply. In the application I used weblogic JDBC driver for Sybase when it was developed in 11.1.1.1.0 version.
    The following are the extries in bc4j.xcfg file:
    jbo.sql92.JdbcDriverClass="weblogic.jdbc.sybase.SybaseDriver"
    jbo.TypeMapEntries="Java"
    jbo.SQLBuilder="SQL92"
    Now I have changed the JDBC to Sybase jConnect (jconn4.jar) and driver class is com.sybase.jdbc4.jdbc.SybXADataSource and other entries remains the same as it was before.
    Thanks
    Jalil

  • Populating a master detail on the same form

    Hi everyone,
    Here is my use case using the HR as an exemple. I need to create a form where I can create an new department (master) and a number of employees for that department (detail) on the same page. On my model I have a Employee view and Department view linked with a foreign key. I created a transient in the department view called nbempl (number of employee). nbempl is linked to a selectitem list where the user can select a number of employee to create for that department. I'm using PPR to display a number of detail rows for the user to fill in.
    My question is how do I create x number of detail rows when the user select a number from the drop-down list? do I need a valueChangeListener on nbempl and create the rows there? could someone point me to examples similar to this.
    Thank you

    Thanks for your reply.
    I looked at the example but my use case is different. I need to populate both the master and detail tables with new records using one form, that is one new record for dept. and any number of detail records as selected by the user. Here is the form i'm working on:
    <h:form>
    <af:panelForm>
    <af:inputText value="#{bindings.DepartmentId.inputValue}"
    label="Dept ID:"
    required="#{bindings.DepartmentId.mandatory}">
    <f:convertNumber groupingUsed="false"
    pattern="#{bindings.DepartmentId.format}"/>
    </af:inputText>
    <af:inputText value="#{bindings.DepartmentName.inputValue}"
    label="Dept Name"
    required="#{bindings.DepartmentName.mandatory}">
    <af:validator binding="#{bindings.DepartmentName.validator}"/>
    </af:inputText>
    </af:panelForm>
    <af:selectOneChoice value="#{bindings.DepartmentsView1NbEmpl.inputValue}"
    label="How many employee do you want to add for this dept.:"
    autoSubmit="true" id="nbempl" immediate="true">
    <f:selectItems value="#{bindings.DepartmentsView1NbEmpl.items}"/>
    </af:selectOneChoice>
    <af:panelGroup partialTriggers="nbempl">
    <af:panelGroup rendered="#{bindings.DepartmentsView1NbEmpl.inputValue > 0}">
    <af:outputText value="#{bindings.EmplTable.inputValue}"/>
    <af:forEach begin="1" end="#{bindings.DepartmentsView1NbEmpl.inputValue}" varStatus="stat">
    <af:panelForm>
    <af:inputText label="Employee ID:" value=""/> <----------------------------- What do I put here ??
    <af:inputText label="Employee Last Name:" value=""/> <----------------------------- What do I put here ??
    </af:panelForm>
    </af:forEach>
    </af:panelGroup>
    </af:panelGroup>
    </h:form>
    The selectOnChoice let the user select a number of detail records to add and the PPR will refresh the form and display a number of input fields in a forEach loop for employee details. Do I need to add a valueChangeListener to the selectOneChoice and insert new rows using a custom method? Is there a better way to do this? what kind of binding do I need in the page def?
    Thank you.
    Edited by: yvesg2 on Sep 17, 2009 5:59 AM

  • Openscript crashing abruptly while trying to record on Oracle Forms

    Hi ,
    I am having issues with OpenScript tool where it is crashing/closing when I am trying to record some actions on Oracle Forms.It seems like a memory issue but I am not sure how to rectify it or investigate what is the cause.Are there any temp files which needs to be cleared ?Are there any logs which I can check to see what the issue is?I am using a Windows-7 machine and running OATS 9.3.
    Thanks,
    Megha
    Edited by: Megha_Agarwal on 23/08/2012 19:45

    Hello Megha
    You can try the following:
    Go to your shortcut to OpenScript in your Programs menu, and right click on it. Select Properties.
    You will see Popup OpenScript Properties. Ther is Shortcut tab located text box Target. Copy the content of this text box in some notepad file, as a back up, and increase Xmx to 1024 for example
    C:\OracleATS\openScript\OpenScript.exe -configuration openscript_configuration -vm C:\OracleATS\openScript\jre\bin\java.exe -vmargs -Xmx512m -XX:MaxPermSize=256m
    You can try different values.
    Let us know the result
    Cheers
    JB

  • BC4J - Inserting Master/Detail records in same transaction.

    I know this is possible, but I seem to be missing something to allow it to happen within BC4J.
    I'm creating a RowSet off of a View Object and inserting new Rows into this RowSet. This RowSet represents my child/detail records for insert into a child table.
    I then create a new Row off of another View Object. This row represents my Master/parent record for insert into a parent table.
    All of the above is being done in the same applicationModule transaction with locking mode set to Optimistic.
    Before I commit the transaction, I grab the next sequence # to use as the primary key for the master record and the foreign key for the child records. I apply those to the newly created child rows and the newly created master row.
    However, when I commit I continue to get a JBO-26041: Failed to post data to database during "Insert": error due to ORA-02291: integrity constraint (CUST_LICENSES_FK4) violated - parent key not found
    If everything was created in the same transaction, why won't this allow me to insert into both tables with the correct primary/foreign keys? It's almost as if the child records are being inserted first prior to the parent record.
    Any ideas?
    Thanks in advance..
    Teri Kemple
    TUSC
    [email protected]

    However, when I commit I continue to get a JBO-26041: Failed to post data to database during "Insert": error due to ORA-02291: integrity constraint (CUST_LICENSES_FK4) violated - parent key not found
    If everything was created in the same transaction, why won't this allow me to insert into both tables with the correct primary/foreign keys? It's almost as if the child records are being inserted first prior to the parent record.This is due to the order of rows being posted. In this case it seems the detail row is getting posted before the master.
    To avoid such situations, either you may implement your own post ordering by making sure that when a detail is to
    be inserted, it's master is inserted or you may use "Composition Association" flag in the association wizard between
    the master and the detail entities to let the framework manage a tight composition relationship between the two entity
    types. BTW, there was another definitive thread recently on inserting master-detail in the
    same transaction, but the forum search engine is so useless I can't find it. Anyone
    have the msgid handy or know how to find that thread again??
    FYI: the help describes the Composition flag functionality in terms of the Master record already existing in the DB. In our problem here, the Master is being inserted in the same transaction. Thus needs to be posted FIRST.
    I got a integrity constraint exception too, then set the composition flag and now I get:
    500 Internal Server Error
    oracle.jbo.InvalidOwnerException: JBO-25030: Failed to find or invalidate owning entity.
         void oracle.jbo.server.EntityImpl.create(oracle.jbo.AttributeList)
         void gov.ga.gdc.otf.bc.JotfWithdrawalsImpl.create(oracle.jbo.AttributeList)
         void oracle.jbo.server.ViewRowStorage.create(oracle.jbo.AttributeList)
         void oracle.jbo.server.ViewRowImpl.create(oracle.jbo.AttributeList)
         oracle.jbo.server.ViewRowImpl oracle.jbo.server.ViewObjectImpl.createInstance(oracle.jbo.server.ViewRowSetImpl, oracle.jbo.AttributeList)
         oracle.jbo.server.RowImpl oracle.jbo.server.QueryCollection.createRowWithEntities(int[], oracle.jbo.server.EntityImpl[], oracle.jbo.server.ViewRowSetImpl, oracle.jbo.AttributeList)
         oracle.jbo.Row oracle.jbo.server.ViewRowSetImpl.createRowWithEntities(int[], oracle.jbo.server.EntityImpl[], oracle.jbo.AttributeList)
         oracle.jbo.Row oracle.jbo.server.ViewRowSetImpl.createRow()
         oracle.jbo.Row oracle.jbo.server.ViewObjectImpl.createRow()
         void gov.ga.gdc.otf.appmodule.JOtfOffenderAppModuleImpl.insertWithdrawal(java.lang.String, java.lang.String, java.math.BigDecimal, oracle.jbo.domain.Number, java.lang.Integer, int)
         void gov.ga.gdc.otf.appmodule.JOtfOffenderAppModuleImpl.payOneObligation(java.lang.String, java.lang.String, java.lang.Integer, oracle.jbo.domain.Number, java.math.BigDecimal, int)
         void gov.ga.gdc.otf.appmodule.JOtfOffenderAppModuleImpl.payObligations(java.lang.String, java.lang.String, java.math.BigDecimal, oracle.jbo.domain.Number)
         void gov.ga.gdc.otf.appmodule.JOtfOffenderAppModuleImpl.receiveFunds(java.lang.String, java.lang.String, int, java.math.BigDecimal, java.lang.String, java.lang.String, java.lang.String, java.math.BigDecimal, long)TIA much! curt

  • How to put detail records in fixed formÉ

    Hi,
    I am trying to build a crystal report based on an existing printed form. The form includes elements that look like the following:
    Activity
    Hot Oiler - 4 mbtu     7mbtu
    Pressure Pumping - 5K   10K   15K
    Travel - 5K   10K   15K
    Standby - 5K   10K   15K
    Each Activity also has a quantity, a rate, and a total (quantity * rate) associated with it.
    The user used to circle the applicable value on the paper form (for example, if it was a 4 mbtu hot oiler vs. a 7 mbtu hot oiler).
    In the application and database the user will enter line items in the work order that specify if it is a Hot Oiler  4 mbtu or a Hot Oiler 7mbtu.  Similarly, the user will create a record that is either Pressure Pumping 5k or Pressure Pumping 10K or Pressure Pumping 15K. And so on.
    The application is capturing all of this information.  I want the crystal report to still display each of these elements as they are laid out on the current paper form however because these are detailed records I do not know how to place them in the report properly. If we take the first line in the form, I created the formula:
    +if {field_tickets_has_resources.resources_id} in [150, 151] then
    "Hot Oiler - " & "4 mbtu" else
    if {field_tickets_has_resources.resources_id} = 163 then
    "Hot Oiler - " & "7 mbtu" else
    "Hot Oiler - "+
    I created another formula for the second line in the form:
    +if {field_tickets_has_resources.resource_roles_id} = 15 then
    "Pressure Pumping - 5K" else
    if {field_tickets_has_resources.resource_roles_id} = 18 then
    "Pressure Pumping - 10K" else
    if {field_tickets_has_resources.resource_roles_id} in [22, 24] then
    "Pressure Pumping - 15K" else
    "Pressure Pumping -"+
    And so on.  However, I cannot place each of these formula beside each other in a details line because it places the values horizontally rather than vertically in the report.  I cannot place these in a header because they are actually detailed records.
    I hope this makes sense. Any help, as always, is appreciated!
    Mark

    Hi Mark, 
    I recommend a similar apporach but the first formula will be created so we can group the records by the Activity type.  For example all the Hot Oilers then Pressure Pumping, etc. 
    We group on this formula then a second formula will build a list of the quantities. 
    One final formula in the Group Footer will display everything on a single line.  We can then hide the Group Header and Detail section because we only want to see one line per actvity type. 
    Create a group on this formula:
    @ActivityGroup
    If {field_tickets_has_resources.resources_id} <> 0 Then
       "Hot Oiler"
    Else If {field_tickets_has_resources.resource_roles_id} <> 0 Then
             "Pressure Pumping";
    This formula will define and reinitialize a string variable for each group.  This goes into the Group Header and can be suppressed. 
    @Initialize        
    WhilePrintingRecords;
    StringVar myQuantity := "";
    This formula goes into the Detail section.  Based on your first formula I'm guessing the Activity Type is based on which field is populated.  I assume only one field per record can have a value that isn't 0. 
    @Quantity        
    WhilePrintingRecords;
    StringVar myQuantity;
    If {field_tickets_has_resources.resources_id} <> 0 Then
       (Select {field_tickets_has_resources.resources_id}
          Case 150  :myQuantity := myQuantity & "4 mbtu "
          Case 151  :myQuantity := myQuantity & "4 mbtu "
          Case 163  :myQuantity := myQuantity & "7 mbtu ";)
    Else If {field_tickets_has_resources.resource_roles_id} <> 0 Then
       (Select {field_tickets_has_resources.resource_roles_id}
          Case 15   :myQuantity := myQuantity & "5K "
          Case 18   :myQuantity := myQuantity & "10 "
          Case 22   :myQuantity := myQuantity & "15K "
          Case 24   :myQuantity := myQuantity & "15K ";)
    This formula goes into the Group Footer and builds your string. 
    @Display     
    WhilePrintingRecords;
    StringVar myQuantity;
    {@ActivityGroup} & "-" & myQuantity;
    All the sections except for the Group Footer can be formatted to hide. 
    Hope this helps,
    Brian

  • "Bad Applet class name" error while recording on Oracle Forms 11g through OpenScript (JRE 1.7.0_17)

    Hi,
    I am trying to record automation functional test script on Oracle Forms 11g using OpenScript.
    Able to open the browser, but after accessing application URL, getting application error as "Bad Applet class name"
    Java Plug-in 10.17.2.02
    Using JRE version 1.7.0_17-b02 Java HotSpot(TM) Client VM
    c:   clear console window
    f:   finalize objects on finalization queue
    g:   garbage collect
    h:   display this help message
    l:   dump classloader list
    m:   print memory usage
    o:   trigger logging
    q:   hide console
    r:   reload policy configuration
    s:   dump system and deployment properties
    t:   dump thread list
    v:   dump thread stack
    x:   clear classloader cache
    0-5: set trace level to <n>
    SSV dialog is suppressed........
    cracked oracle.forms.engine.Main
    Loading cached Forms Jars ...
    Is this version (Oracle forms 11g, JRE 1.7.0_17) supported by OATS-OpenScript ?
    Please advise if there is any work around here.
    Thanks.

    From the last OATS release notes available in the C:\OracleATS\docs directory:
    4.1 Oracle Functional Testing/OpenScript
    Oracle Functional Testing’s OpenScript scripting platform has the following system
    requirements:
    ■ Operating System (32-bit and 64-bit versions): Windows XP, Windows Vista,
    Windows 2003, Windows 7, Windows 2008, Windows 2008 R2.
    ■ Memory: Minimum 1 GB
    ■ System: x86, 32-bit or 64-bit processor, 2.6 GHz or faster
    ■ Disk Space: 4 GB minimum
    ■ Browser: Internet Explorer 7.x, 8.x., 9.x; Firefox 3.5/3.6, 6.x, 10; Chrome 27+
    (playback only).
    ■ Java Runtime Environment: JRE 1.6 minimum (up to build 38), JRE 1.7 (up to build
    11) .
    So basically, it's not supported... Can you try with another JRE version?
    As always don't forget to run OpenScript as administrator on W7/8 or equivalent
    JB

  • Problem with inserting new records in Oracle Forms

    Hi Friends,
    I am a new user to Oracle Forms and I need a help from you people. The problem is as follows:
    I have a data block in which I can display a number of records. In this data block the user will be able to edit the fields if no child records are found in another table. I have used when-new-record-instance to attain this scenario. All are text items. One item licensee_id which is made invisible by setting the property in property palette and required=no ( as this is the primary key of the table). Also the audit columns are made invisible.
    The code for it is as follows:
    DECLARE
         v_alert_button NUMBER;
         v_cnt                          NUMBER;
    BEGIN
         SELECT COUNT (*)
    INTO v_cnt
    FROM id_rev_contracts
    WHERE licensee_id = :ID_REV_LICENSEES.licensee_id;
    IF v_cnt > 0 THEN
    set_item_property('ID_REV_LICENSEES.LICENSEE_NAME', UPDATE_ALLOWED, PROPERTY_FALSE);
    ELSE
         set_item_property('ID_REV_LICENSEES.LICENSEE_NAME', UPDATE_ALLOWED, PROPERTY_TRUE);
         -- set_item_property('ID_REV_LICENSEES.LICENSEE_NAME', INSERT_ALLOWED, PROPERTY_TRUE);
    END IF;
    END;
    Now in this data block I should also be able to insert new records and for the same I have used PRE-INSERT trigger and the code for it is as follows:
    DECLARE
         v_alert_button NUMBER;
    CURSOR v_licensee_id IS SELECT id_rev_licensees_s.NEXTVAL FROM dual;
    BEGIN
    OPEN v_licensee_id;
    FETCH v_licensee_id INTO :id_rev_licensees.licensee_id;
    CLOSE v_licensee_id;
    IF :id_rev_licensees.licensee_id IS NULL THEN
    Message('Error Generating Next v_licensee_id');
    RAISE Form_Trigger_Failure;
    END IF;
    :ID_REV_LICENSEES.created_by := :GLOBAL.g_login_name;
    :ID_REV_LICENSEES.last_updated_by := :GLOBAL.g_login_name;
    :ID_REV_LICENSEES.create_date := SYSDATE;
    :ID_REV_LICENSEES.last_update_date := SYSDATE;
    EXCEPTION
    WHEN form_trigger_failure
    THEN
    RAISE form_trigger_failure;
    WHEN OTHERS
    THEN
    v_alert_button :=
    msgbox ('ERROR in Pre-Insert - ' || SQLERRM, 'STOP', 'Contact IST');
    RAISE form_trigger_failure;
    END;
    Every thing is compiling fine but at the run time when I am trying to insert a new record I am receiving the following error:
    FRM-40508:ORACLE error:unable to insert record
    I also think the pre-insert record is not firing at the time of inserting a new record and saving it. So I request you to please delve into this problem and suggest me how to overcome this problem. Code snippets would do more help for me. If you need any other things from me please let me know. I will see if I could be of any help in that concern because I may not be able to send the entire form as it is.
    Thanks and regards,
    Vamsi K Gummadi.

    first of all
    pre-insert fires after the implicit/explicit commit/commit_form is issued and before the real insert is submitted to the db.
    i would suggest to remove the error handling part for the moment
    because i believe you might be getting "ora-xxxx cannot insert null"
    and also make visible the primary column to check if the pre-insert is executed.
    it would be better to make visible for a while the not null columns of the table/block
    i suppose that the block is insert allowed and you are using table as the source of the block and not any procedures or something...

Maybe you are looking for