Create Master details(Parent and Chid)  record

Hello,
I have created a view link on two entity object A and B which is in master-details relationship.
However, when I new A, i found that only the object instance of A is created.
How can I create the entity object instance of both A and B programmaticlly at the same time?
Thanks

Hi,
maybe this will help you
How to insert  new records in Master and detail Forms.
Regards,
Dimitris.

Similar Messages

  • 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

  • Creating master-detail VO in custom AppModule method

    Hi.
    I need to create master-detail view objects and save them in DB in my custom AppModule Service Interface method.
    I have the next master-detail view objects:
    RegistryVO (1) -- (*) RegistryItemVO
    Also I have a view link for this relationship.
    I wrote custom method with next signature:
    Integer createRegistry(RegistryVORowImpl registry) {
    Then, I added this method to my AppModule Service Interface.
    Method works fine, but only master row is created and inserted to DB (only Registry but not RegistryItem). I.e. when I testing this method in EM I fill full RegistryVO with nested RegistryItemVO data but in my method RegistryVO comes without nested RegistryItemVOs.
    Then, I added SERVICE_PROCESS_CHILDREN custom property to view link (RegistryVO-RegistryItemVO) as it described in chapter 11.2.5 of Fusion Developer 's Guide for Oracle Application Development.
    After that nested RegisttryVO in my method contains nested RegistryItemVOs.
    In my custom method i need to set primary key for RegistryVO. So I set it in registryVO to PK attribute and set it in nested registryItems to FK attribute.
    But when I doing commit I have an exception:
    Exception while executing the business logic: JBO-26048: Constraint "PP_PST_RG_IT_PP_PST_FK" is violated during post operation "Insert" using SQL stat
    ement " *INSERT INTO PP_PERSON_ST_RG_ITEM* (PP_PERSON_ST_RG_ITEM_ID,IN_DOCUMENT_ID,POL,FULLNAME,NAME,FULLOT,TIN,D_ROG_DT,D_REEST
    _DT,PROCESSING_DT,PROCESSING_STATE_CD,RECEIVE_YEAR) VALUES (:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11,:12)".: ORA-02291: integrity
    constraint (PP_PST_RG_IT_PP_PST_FK) violated - parent key not found
    It seems that only registryItems are commited in DB. I'm not seeing INSERT for Registry in ServieInterface log...
    But if I setting primary key for RegistryVO when I invoking method (if I setting id for registry in test console of EM, not in method) - it's work fine .
    What I'm doing wrong ?
    How can I create custom method for AppModule Service Interface to create master-detail view objects and set PK for master and FK for details within method ?
    Edited by: user2975420 on 19.10.2010 4:46
    Edited by: user2975420 on 19.10.2010 4:49

    Thanks for reply, John.
    I have already added master and detail view objects usages to my AppModule Data Model. And yes, I add detail VO as child of master.
    It seems that the reason of my problem is another...
    I can't create master/detail when I'm setting id of master in custom method. If I set id of master in input parameter (RegisterVORowImpl) then method invokes successfull.
    I noted one moment - if I'm not setting SERVICE_PROCESS_CHILDREN custom property for view link, I can set id of master VO inside method. But in this case my master VO haven't got nested RegisterItemVOs.
    Edited by: user2975420 on 19.10.2010 10:23
    Edited by: user2975420 on 20.10.2010 1:31

  • Master Detail Wizard and User Interface Defaults

    Trying to create a master/detail form (on one page, no report).
    1. Wizard is giving the option to use User Interface Defaults for the master table, but not for the detail (I don't want to for either) - is this the expected behaviour? If so, why the inconsistency? Will/can this be changed in the future?
    2. Despite selecting NOT to use UI defaults, and entering new region titles, wizard is creating default region titles using the UI defaults. Is this a bug?
    3. Supplementary: Is it possible to get rid of UI defaults?
    HTML DB 1.6.0.00.87

    I asked about this last month:
    Master Detail Wizard and User Interface Defaults
    with no response.
    Anyone?

  • Error creating Master/Detail Form

    Hi,
    I tried to create a master detail form. I went through all the steps fine, only when i click the button to create the form, i received the following errors:
    ORA-20001: Unable to create master detail page. ORA-06502: PL/SQL: numeric or value error: character to number conversion error
    Unable to create Master Detail pages.
    Could someone please tell me what's wrong?
    Thanks,
    Patrick.

    We are getting this message in several areas in the development environmnet. It's happening in the developer login screen, when creating new tabs, and when tryig to create master detail reports. Here is our error from the Apache Log:
    [Mon Mar  2 11:41:31 2009] [error] [client 10.64.8.231] [ecid: 1236012090:148.94.143.136:24226:0:1621,0] mod_plsql: /pls/apex_qmnt/wwv_flow.accept HTTP-404 ORA-06502: PL/SQL: numeric or value error\nORA-06512: at line 31\n
    I think this is different from the issue above as that is due to too many items in a shuttle list. Ours seems to be related to our new APEX insstallation. Any help is appreciated here.

  • Trying to create Master - Detail form, getting  ORA-06502: PL/SQL: numeric

    Anyone know why we might get this error trying to create a Master Detail form in HTMLDB 2.0?
    ORA-20001: Unable to create master detail page. ORA-06502: PL/SQL: numeric or value error: character to number conversion error
    Unable to create Master Detail pages.
    Return to application.

    Please create the failing case in your workspace on apex.oracle.com and tell us the workspace name, app ID and steps to recreate.
    Scott

  • Unable to create master detail report

    Hi,
    I´ve two tables (Organisation and Purchases) and want to create a master-deatil with the wizard.
    At the end an error occurs:
    ORA-20001: Unable to create master detail page. ORA-06502: PL/SQL: numeric or value error: character to number conversion error
    Unable to create Master Detail pages.
    Return to application.
    Any ideas ? Any reaction will be appreciated
    Leo

    Leo,
    How are your two tables related? Do you have a foreign key constraint? It sounds like that there may be a datatype mismatch between the master table's PK and the detail table's FK - check to make sure that they are both NUMBER.
    Thanks,
    - Scott -

  • Having problem with creating Master Detail form , please help

    I have to work on a project to create a survey system using APEX, as am new on using this tool , am still facing some problems to finish my job..
    i created Master/Detail form using wizard, the master form is working fine but am when i try to add data using the detail form its giving me 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 = "A884FA378C851786DDFE3A33709CB23C", item checksum = "5F8B1EE5CD3D46437455F43B37B9A6A0"., update "ABA"."ABA_SURVEY_SUBCATEGORY_MAST" set "ASCM_CATEGORY_ID" = :b1, "ASM_SURVEY_CODE" = :b2, "ASSM_SUBCATEGORY_ID" = :b3, "ASSM_SUBCATEGORY_DESC" = :b4
    i tried to go through the posts from others but i still dunno what is this error !!!& how to solve it..
    my master data table have 2 primary keys.. the details data table have 3 primary key all of them using trigger to fire a sequence to get the next_val!!
    am desperate & need help urgently for this ASAP.

    hello
    here is the solution,i hope this might help u.
    go to the code of your button and change write the following
    go_block('name of your master block');
    execute_query(no_validate);
    and in the object navigator make the first item in the master
    block that it should be displayed in the canvas and it must be a
    navigable item too.not a display item.
    thank you
    Zeeshan Ahmad

  • Go to detail page and update record at the same time

    Hi guys,
    I`m very new to dreamweaver and have no coding skills, so
    please be gentle.
    I`m have created a mail box and it all works fine, the
    problem i`m having is that I want to be able to tag wether a
    message has been read or not.
    So the subject has to be a link so when someone clicks the
    subject you are redirected to the read message page and it displays
    the message in full.
    My question is there a way to go to detail page and update
    record at the same time?
    I`m using ASP and the mysql read or not field is a SET

    "mrmidjam" <[email protected]> wrote in
    message
    news:fghrpf$7s2$[email protected]..
    > Hi guys,
    >
    > I`m very new to dreamweaver and have no coding skills,
    so please be
    > gentle.
    >
    > I`m have created a mail box and it all works fine, the
    problem i`m having
    > is
    > that I want to be able to tag wether a message has been
    read or not.
    >
    > So the subject has to be a link so when someone clicks
    the subject you are
    > redirected to the read message page and it displays the
    message in full.
    >
    > My question is there a way to go to detail page and
    update record at the
    > same
    > time?
    You can use the Update Record ZerverBehavrior and then have
    it redirect to
    the detailpage.
    Joris

  • How can I create master detail reprot output

    Hi to all!
    I have one question about creating master-detail report.
    My report must show asset's and depreciation and all other information for that asset. I can have one asset at two or more locations, cost numbers, ...
    Now I have 2 SQL's in my XML file. Q1 is master data for some asset and Q2 is detail for that asset, if I run my report with all parameters (book type, asset nubmer, cost nubmer) then it runs OK (I get master-detail report, for each asset I get separate page, even if asset has multiple cost number or locations), but if I run that report without cost number parameter I get multiple pages for master (data from Q1 on each page), but detail data is all together on each page.
    Can you help me how can I also get separate detail data in that case?
    I hope we understand each other!
    Regards,
    drama9346

    Hi Mustafa,
    Thanks for ur response.
    Actually, In my first tab page I have some details of employ which is based on a database table.
    The second tab page also contain the details of employ which based on backend stored procedure. I used a REF cursor in that stored procedure.
    When I have created a master detail relationship based on employee_id, it created the relationship but while executing the form it is giving error like
    'pk_empdetails.query' must be declared.
    pk_empdetails.query(is backend procedure).
    Hope u got my point.
    Regards
    sonali
    null

  • Query to delete both parent and child record....

    hai.........
    I tried to delete a record from the table.... but i get a error saying 'child record' exist cannot delete record'.... can u plz tell me the query to delete both parent and child record....
    plz help me.....
    anoo...

    Hello,
    Is already answered in {thread:id=824593}. Please mark the question as answered.
    Greetings,
    Roel
    http://roelhartman.blogspot.com/
    http://www.bloggingaboutoracle.org/
    http://www.logica.com/

  • How to Create Master-Detail OA Page

    Hi,
    I'm trying to create Master - Detail Page in OAF, but i can't find right way to do that.
    Can anyone please explain me in steps how to create or give me any document/web link for reference.
    Thanks,
    SAN

    Hi
    chk below links
    http://oracle.anilpassi.com/master-detail-screen-in-oa-framework-part-i-2.html
    http://oraclearea51.com/blog/master-detail-page-in-oa-framework.html
    Thanks
    Pratap

  • 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

  • ADF TreeTable One row data to create a master-detail parent-child relation

    I want to display an editable detail table on a page. The problem is the detail table has many fields so that the screen scrolls horizontally. I need my page to just fit on one page without scrolling.
    now my idea is to use a TreeTable. A lot of fields on the detail table will act as children of the main node so I can fit the table onto one screen without scrolling.
    So there is really no master detail relationship because Im referring to the same row data.
    Not the usual use case of using a Tree Table but just wondering if this is possible. I posted this hoping that anyone could shed a light on this.
    regards,
    Anton

    You can do that like in this example:
    http://apex.oracle.com/pls/apex/f?p=31517:278
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.apress.com/9781430235125
    http://apex.oracle.com/pls/apex/f?p=31517:1
    http://www.amazon.de/Oracle-APEX-XE-Praxis/dp/3826655494
    -------------------------------------------------------------------

  • Creating master detail rows

    using adf/bc with jsf. I have defined a master detail relationship between two entities. This relationship is a composition relationship. The entities are related by a view link which link the master and detail view objects. i have a need to create/insert a master row and a detail row programmatically "on the fly" so that when the jsp renders, the user will see blank inputs for both the master and detail view objects. The problem is that the primary key of the master record is not known at creation time ( it will be entered by the user) and therefore the detail record cannot be created by the framework because of the unknown value of the parent's primary key. I was hoping the following section in the adf guide would eliminate my problem, but it doesn't appear to:
    This is from section 26.7.3.2 of the adf developer's guide
    Note: An alternative to the programmatic technique discussed
    above, which solves the problem at the J2EE application layer, is the
    use of deferrable constraints at the database layer. If you have control
    over your database schema, consider defining (or altering) your
    foreign key constraints to be DEFERRABLE INITIALLY DEFERRED.
    This causes the database to defer checking the constraint until
    transaction commit time. This allows the application to perform DML
    operations in any order provided that by COMMIT time all appropriate
    related rows have been saved and would alleviate the parent/child
    ordering described above. However, you would still need to write the
    code described in the following sections to cascade-update the foreign
    key values if the parent’s primary key is assigned from a sequence.
    This approach did not help in allowing me to create the detail record without first knowing the value of the parent's primary key record in a composition relationship. The only thing i've found to work is define the relationship as just an association, and not a composition. However, this is a true one to many (composition) relationship and i would like to take advantage of some of the features of the framework that are there when a relationship is defined as a composition relationship. Is there any way to do what i need to do with a composition relationship defined between these two entities? Thanks.

    Hi,
    I guess you need a "Cascading LOVs".
    1) Create viewObject for country values list. Named VO1.
    2) Create viewObject for state values list. Named VO2.
    3) Create view criteria for (bind variable) VO2 which can restrict the result by country.
    4) Create view accessor to get VO1.
    5) Create view accessor to get VO2. Define the bind variable value which can provide country info dynamically. I guess it should be a Groovy expression.
    6) Create country LOV on step 4) view accessor.
    7) Create state LOV on step 5) view accessor.
    Done
    On the view layer, you may enable PPR between country and state attributes.
    Todd

Maybe you are looking for

  • How to print Signature in smartform in a dynamic place ?

    Hi experts,                 i have a requirement to print signature in a smartform (purchase order print) ,the signature has to printed in dynamic place.                 i have  to Print signature in in authorized signatory place, we cannot place sta

  • [perl] Writing my first module (IPTables::Rule); Looking for feedback

    Well pretty much as the subject says... I've been hacking away with perl for a while, but this is the first time I've tried writing a module. I think (hope) I'm on the right track in terms of doing it the "right" way (or one of the X "right" ways per

  • Change text problem CS3

    I am having problems with i2of5 barcode where some of the encoded values for the barcode are the same as InDesign values. e.g. find text "barcode" change text "ËU(K\tÌ" inDesign recognizes the \t for a tab. Is it possible to turn off these keywords o

  • Realize Gantt Chart in Catalyst

    I am not quite shure that its possible or even ment to be done with Catalyst, thats why I am asking if its possible. And when its possible how I got a Illustrator File containing all Elements of a Gantt Chart like TaskItems, Milestones a Top bar show

  • Please tell us the exact date for Belle update for...

    please tell us the exact date for Belle update for who's waiting availability since 11 days. for me i have N8 orange french CP 059C3H1 more than 11 days i'm waiting but no thing in the horizon. Solved! Go to Solution.