Create lines of master / detail in Application Module Impl

Hello

I use Studio Edition Version 11.1.2.3.0

I need to create programmatically from the lines of master / detail of a method in my Application Module Impl.

I'm using the code below, but they always tell me that the foreign key is required in the detail row: oracle.jbo.AttrValException: Houston-27014: UserId in UserPreferenceEO attribute is required.

Can anyone recommend the correct way to do this?

Thank you very much

NVP NameValuePairs = new NameValuePairs();
nvp.setAttribute ("name", "value");
RegisteredUsersVORowImpl = (RegisteredUsersVORowImpl) getUsers () .createAndInitRow (nvp) userRow;

Create the line of userpref
Get the detail line via the accessor on Master table display
userRow.getUserPreferencesVO () .createAndInitRow (null);

getTransaction () .commit ();

I had a simular problem a few weeks back.
To a master VO you must:

this.getMasterVO().createRow();

And for a VO detail:

Row row = this.getDetailVO().createRow();
...do stuff with the row...
this.getDetailVO().insertRow(row);

Given that the captain creates and retail CreateInsert

Tags: Java

Similar Questions

  • Creating lines of master / details in a table

    Hello

    How to create the relationship of the master / detail between the columns in a table?

    For example, I have a table with 3 columns as address (input box), Country (a selection list box), State (select one box list). I create State LoVs using view accessors for table and country view object. By choosing a country, I need to dig the status column values according to the selected country.

    Thank you.

    Hello

    I guess that you need a "cascading LOVs.
    (1) create viewObject for list of country values. Named VO1.
    (2) create viewObject for list of status values. The name of VO2.
    (3) create view for (variable binding) VO2 criteria that may restrict the result by country.
    (4) create view accessor to get VO1.
    (5) create view accessor to get the VO2. Set the value of the bind variable which can provide country information dynamically. I guess it must be a Groovy expression.
    (View accessor 6) Create country LOV on step 4).
    (View accessor 7) create the State LOV on step 5).

    Fact

    On the view layer, you can enable PPR between countries and the States of the attributes.

    Todd

  • Using wizard to create forms of master / detail

    Hi guys,.

    I'm using JHeadstart 11.1.1.3.35 and having major problems trying to create records of master / details in a layout of the wizard

    Department Master (shape, style Assistant, insert enabled, new line on entry)
    Group of retail employees (form, data dependant, allowed insert, update has allowed)

    Using schema HR with a view link between services and employees

    Main group Department (Assistant)
    = > Region of the element (all the fields of the Department)
    = > Region container
    = > Region group (Group of retail employees)

    (NB - if I used a group of the region as step in the wizard at a higher level, the following error occurred during the generation which is why I wrapped it in a container of the region...

    [NewDepartmentNewEmp.jsff, default/pageComponent/formRegionGroup.vm] Journal of speed [error] method pushModelPointer threw the exception of reference $JHS for model default/pageComponent/formRegionGroup.vm at [1,1]
    [NewDepartmentNewEmp.jsff, default/pageComponent/formRegionGroup.vm] org.apache.velocity.exception.MethodInvocationException: Invocation of method 'pushModelPointer' in class oracle.jheadstart.dt.jag.engine.velocity.JagEngineFacade threw exception class java.lang.NullPointerException: null

    The problem is that the detail of employee group does not start in design mode.

    I tried the create() method substitution in DepartmentsImpl

    protected void create (AttributeList attributeList) {}
    Super.Create (AttributeList);

    NewEmployee RowIterator = this.getEmployees ();
    NewRow row = newEmployee.createRow ();
    newEmployee.insertRow (newRow);
    }

    I also tried the override of the executeQueryForCollection method in detail (saw this solution suggested in another post on creating a form-form master / detail)

    protected void executeQueryForCollection (Object, object,
    Object [] bindParams,
    int i) {}
    super.executeQueryForCollection (object, bindParams, i);
    If (getEstimatedRowCount() == 0) {}
    Line = createRow().
    insertRow (row);
    row.setNewRowState (Row.STATUS_INITIALIZED);
    }
    }

    Nothing works well. I want to be able to use a wizard to create a record of master / detail in presentation view shape-to-shape. Is it possible, using a detail group, or do I have to create a separate view object that contains two master entity objects / detail in it and then just use the only VO in the Group Assistant of JHeadstart.

    This seems a very basic requirement, I clearly do something wrong!

    See you soon,.
    Brent

    Brent,

    To start in design mode, you must create the Group NewDeptEMp as a top-level group, so he will have his own taskflow. You can then define the new display line on the input property.

    In your wizard NewDept, you create a group of the region DIRECTLY under the container of the separatePages region, check "Include as ADFc region" then select the NewDeptEMp group.

    To work around the error that you got during the generation of the group in the region as an immediate child of the container sepeartePages, use the following code to formGroupRegion.vm:

    # revision_history
    # Steven Davelaar 28-sep-2011
    Additional support # 1.2 for the group in the region as child of separatePages region container
    Team JHeadstart # 30-sep-2006
    Historical revisions # 1.1 added, the basic version is 10.1.3.0.97 (SU1)

    #if ($JHS.page.itemRegion)
    #JHS_PARSE ($JHS.page.itemRegion.templateIdentifier $JHS.page.itemRegion)
    #elseif ($JHS.page.regionContainer)
    #JHS_PARSE ($JHS.page.regionContainer.templateIdentifier $JHS.page.regionContainer)
    #elseif ($JHS.page.groupRegion)
    #JHS_PARSE ($JHS.page.groupRegion.templateIdentifier $JHS.page.groupRegion)
    #end

    Steven Davelaar,
    Jheadstart team.

  • Create a form master detail.

    Hello

    I am creating a form master detail following this tutorial: Blog of Zeeshan Baig: master form design / detail in Oracle ADF

    However, I'm stuck at this stage where I need to create a link to the view. I'm not able to add the departmentview departmentid. The Add button is not turning on.

    Please refer to the screenshot below. Thank you.

    cvl2.jpg

    You have chosen DepartmentsView in both places.

    You must choose the DepartmentsView to the source and the EmployeesView in the destination.

    See you soon

    AJ

  • How to create the column of the table for long-form Master detail relationship

    Apex 4.1

    Oracle 11g

    I created a form master detail and see the main table hotel_list and table hotel_mapping as detailed below.

    Hotel_list

    ID HOTEL_NAME

    1 Holiday Inn

    Hotel Hilton 2

    Hotel_mapping

    ID HOTEL_NAME MAPPING_NAME

    1 Inn Holiday Inn Select hotel

    2 holiday hotel Holiday Inn Select

    3 hotel Holiday Inn Holiday Inn Hotel

    4 Hilton Hotel Hilton Hotel chain

    Hotel Hilton 5 HiltonHotel

    Table Hotel_name Hotel_list is a linked table Hotel_mapping

    When I add a line to the Hotel_mapping table for the selected row in the hotel_list table, mapping_name of column is null, therefore impossible to create the relationship between the main table and the secondary table.

    I would like to know, how to create the relationship?

    Thank you very much

    Best regards

    Yong Huang,

    simple step see creating a form detailed master with APEX - Assistant Master retail

    and check how to maintain the relationship between two tables,

    simple return the packaged application «Sample of Masters details»

    and try to understand this concept...

    In your example, use Hotel_list.ID as a foreign key in the table Hotel_mapping

    and maintain the relationship with the column ID...

    and choose the display type of the column Hotel_list.ID in table Hotel_mapping as List(Query Based LOV) select.

    otherwise the best way is to create sample on oracle.apex.com

    I hope this helps...

    Leave.

  • Restore does not work in a web service that is created from an application module method

    Hello world

    I use jdeveloper 11.1.1.7.0

    I have a pl/Sql function named "InsertTest" that makes a lot of calculation and the DML operations (for example, insert and update tables) effective on many tables, while there no COMMIT in a pl/sql function.

    In a class of application module, I created a function (callDBFunction()) that calls the pl/Sql function,

    and I want to only use the result of a pl/Sql function, and at the end I restore all changes that are created in the pl/Sql function (using this.getDBTransaction () .rollback ()).

    // in application module impl class
    public void callDBFunction() {
    
      CallableStatement plsqlBlock = null;
      String statement = "BEGIN :1 := InsertTest(); END;";
      try {
      plsqlBlock = getDBTransaction().createCallableStatement(statement, 0);         
      plsqlBlock.registerOutParameter(1, OracleTypes.VARCHAR);
      plsqlBlock.executeUpdate();
      String rslt = plsqlBlock.getString(1);
    
      //..... use the result of plSql function
    
      this.getDBTransaction().rollback();  // rollback all changes
    
      } catch (SQLException e) {
      e.printStackTrace();          
      }
    }
    
    
    
    
    
    

    Then, via the tab of the Service Interface, I created a web service of the function above.

    When I test the web service and call the function, any changes made to the pl/Sql function is committed in the database.

    in fact it seems that the line "this.getDBTransaction () .rollback ()" in the code above was useless (doesn't work).

    How can I restore in this case?

    Habib

    Concerning

    If I call the function via the request module Tester, all changes rollback and it works as I hope.

    but in the case of service web when calling the function all changes are committed to database.

    This probably confirms my hypothesis that when you instantiate AM of ADFBC WS, connection has autocommit = true.

    You can try to change this with: plsqlBlock.getConnection () .setAutoCommit (false) before calling your plsql procedure.

    Dario

  • Mode of transitional Masters details creating line items

    Hello

    I try to create detail rows masters transitional objects in view.
    However, not be able to see the lines created correctly under respective parents.

    Components:
    DeptVO
    EmpVO
    DeptToEmpVL

    Configuration of the AOS:
    DeptVO1
    -EmpVO2 (CHILD)
    EmpVO1

    Method AmImpl:
    public void createRows() {}
    Line line, row2.
    for (int i = 0; i < 4; i ++) {}
    line = getDeptVO1 () .createRow ();
    row.setAttribute ("DeptId", "Dept" + i);
    row.setAttribute ("DeptName", "Dept" + i);
    getDeptVO1 () .insertRow (row);
    }
    for (int i = 0; i < 4; i ++) {}
    for (int j = 0; j < 5; j ++) {}
    row2 = getEmpVO1 () .createRow ();
    row2.SetAttribute ("EmpId", i + "" + j);
    row2.SetAttribute ("DeptId", "Dept" + i);
    row2.SetAttribute ("EmpName", "emp" + i + j);
    getEmpVO1 (.insertRow (row2));
    }
    }
    }

    The execution of the method above to fill the parent records and child. When I see records dept, it does not appear associated emp lines.

    Can anyone help how can I optimize creating transitional lines for master-details records.

    Version using Jdev 11.1.1.6

    Thank you
    Srini.

    Hello

    Then why can't you fill in all the lines of masters for the Department and access it via an iterator and complete children lines by Department by copying the other child view object.

    All I'm saying is that the approach is wrong, as rowset child of the master is different then the one you are filling, so it wouldn't work and it is how the product works.

    --
    Birame

  • Cannot create relationship master detail for datablock

    Hi guys, my form currently has a relationship master detail for 1 datablock and everything works well. I now have a need to do a datablock different, based on the same table as the previous datablock but for some reason any that it won't let me create the same master-detail relationships, as I did on the 1st slice (and I need the same relationships to sort the block shows the same data as the previous datablock).

    Anyone know why it won't let me create the relationship?

    I encountered a similar problem before. When you say that you cannot create relationships is - it simply because you cannot select the master/detail through the wizard? If this is the case, you should be able to make the relationship manually, or at least I could when I had the same problem. Although I can't help, but wonder why it wouldn't let you select them in the wizard. There may be an underlying reason for this. But anyway, try and make the relationship manually and let me know if it works.

  • master/detail relationship through two workflow

    Hello world

    I use jdev 11.1.1.7.0.

    In my application, I created a relationship master-detail between departments and employees (departments is master and employees is detail). Then, I created two stubborn workflow.

    Department-stream with a department.jsff and I drag / drop the departmentVO as a form.

    dep.png

    employee-stream with an employee.jsff, on this page I drag / drop employeeVO located under departmentVO in the control panel of data:

    emp2.png

    can I use these two TFs (Department-flow and employee-flow) through two different ways

    1- I create a main.jspx page and I put two TFs as an area on main.jspx.

          <af:form id="f1">
            <af:region value="#{bindings.departmentflow1.regionModel}" id="r1"/>
            <af:region value="#{bindings.employeeflow1.regionModel}" id="r2"
                       partialTriggers="::r1"/>
          </af:form>
    
    

    in this case when I run the homepage, two TFs are in sync with each other, I mean when I navigate between departments in the workflow Department, employees in the employee flows are discount

    and also if I enlist in the workflow Department then changes in the flow of employee will be validated.

    2- in this case first I create a master stream with an master.jsff and then I put two TFs as an area on master.jsff.

     <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
              xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
      <af:region value="#{bindings.departmentflow1.regionModel}" id="r1"/>
      <af:region value="#{bindings.employeeflow1.regionModel}" id="r2"
                 partialTriggers="::r1"/>
    </jsp:root>
    
    

    and finally I put flow master as a region on the page main.jspx.

           <af:form id="f1">
            <af:region value="#{bindings.masterflow1.regionModel}" id="r1"/>
          </af:form>
    
    

    in this case, when I run the main.jspx , always the two page two TFs are in sync with each other (updating of employees when I navigate between departments)

    but in this case the validation in the workflow Department commit not changes in the flow of employee.

    Anyone know how I can I have this (validation cause Department-stream flow used as case 1)?

    Habib

    Concerning

    Habib,

    I just did what you said.

    1. Ran the mainWithMasterFlow.jspx,

    2. the Department rendered initially has only one employee.

    3. has changed the salary. (Kept the emphasis placed in the same field)

    4 click "Commit".

    Above scenario failed, because the change in value has not been submitted. Try adding autoSubmit = true for the salary field and then repeat the procedure, you will see the file be saved.

    Rambeau

  • ADF:how update attribute of link seen in master-detail relationship.

    Hi all

    I use jdev 11.1.1.5.0 version.

    I created a form master / detail using view link. My requirement is the Key attribute update sacrificed on Master table and same attribute on table automatically put details far because it fits on the link attribute.

    but his past when I change attribute link view main table, detail line stop display table.



    Thanks in advance

    Manish

    Your link on the association and for this assoc basic display, check the key attributes of the Cascade Update:

    https://blogs.Oracle.com/raghuyadav/entry/adf_entities_association_-_Cas

  • Problems on master detail CRUD

    Dear all,

    I'm trying to understand how ADFBC manages the relationship master detail like this
    is the first time where I need to manage the table relation.
    Practice, I only used a table but this time I need to manage the relationship, too.

    I have two tables that follow. They have a to-many.
    PART_ID in the PARTS_CODE table is filled by a sequence of DB.
    PARTS_CODE                                   PART_DESC
         - PART_ID (PK)                              - PART_ID (PK)
         - RANGE                                   - REGION  (PK)
         - CATEGORY                              - DESC
    Use case is like this:
    Table PARTS_CODE contains data on the parties while PARTS_DESC contains information on the description of the specific region of the parts.

    Now, I created a View object that links the two tables. Then I drag this display object from
    my data as a control table update-able.

    I just have a few questions on the implementations:
    1 when I drag and drop the CreateInsert button and click on it, I noticed that it adds a new line to the
    table, but I noticed that it creates the Text Input component only on the associated columns
    the PARTS_CODE Table, the other columns for the PART_DESC does not have the user interface components.
    How to solve this problem?

    2. how to manage the relationship such that when it inserts the data on the PARTS_CODE, I need
    to get the DB generated sequence number and put it in the PART_DESC table

    3. any demonstration/links which shows the CRUD operations involving arrays of master detail?

    I searched the forum for Crud master / detail, but I can only see the display of the relationship and not
    CRUD operations.

    Found this blog too http://andrejusb.blogspot.com/2009/03/create-operation-for-master-detail.html, but
    I can't even fully understand.

    JDEV 11G PS3

    Thank you

    You will need to create a black and white view link in your main table and details. The blog provides the code example if you step through the code, you will get to know exactly how it's done.

  • detail record in master-detail of the removal

    Hi all

    I created the table master / detail in oracle form 6i

    It has two tables, now I want to delete the data in my table of detail, how I remove it, I want to just delete a single database at a time

    Thanks in advance

    Thank you
    Aerts.

    As andreas says it should delete record. I think that you created the button outside the block in which you want to remove
    recording. You must write the code like this

    GO_BLOCK ('DETAIL_BLOCK_NAME');
    DO_KEY ('DELETE_RECORD');

    and the time that you want to recalculate again when records are delete. Then, you will have to
    write the code below your inside... I mean right now adding it to first REMOVE deduct.
    something like that...

    -Clément

  • [ADF, JDev12.1.3] master / detail af:tables the link is handled by ExecuteWithParams: how to create a master report / detail in a loop on the lines?

    Hallo,

    I have a page with 2 legs and they both contains an af:table created by dragging an instance of VO in the user interface.

    The 1st tab uses a master VO while the 2nd uses a VO detail.

    Between 2 your, there is not a link of VO master / detail.

    Opening Details tab I update the secondary table by calling the method ExecuteWithParams of the detail VO instance (in a managed bean).

    I would now like to generate a report that loop on the master table and that, for each line of master:

    • He writes in the report;
    • loops of registration of details (which are based on the master record) and also writes the report.


    Could you kindly suggest me which is the best way to achieve that through a code to write in a managed bean?

    Here I am interested how do to loop through the data, not in how to write the report.

    Thank you

    Federico

    Yes it will affect the selected line. If you want to ignore try using this code

        DCIteratorBinding iter = (DCIteratorBinding) BindingContext.getCurrent().getCurrentBindingsEntry().get("DepartmentsView1Iterator");
        ViewObject vo = iter.getViewObject();
        for (int i = 0; i < vo.getEstimatedRowCount(); i++)
        {
          Row r = vo.getRowAtRangeIndex(i);
          System.out.println("DeptId= " + r.getAttribute("DepartmentId"));
        }
    
  • Form master / detail apex 5 tries to update the lines of details without apparent change

    A form master / detail of Apex default 5.0 creates buttons back and forward on the main table. When you move between records, the detail region launches a message: update 0 row (s), 0 or the inserted rows.

    Glance in occasional of the user, it will look like a mistake: I, what has changed and why it has not been saved?

    If nothing has changed, why is a MRU statement update being generated?

    How do I remove this behavior? Is this a bug?

    You can see in https://apex.oracle.com/pls/apex/f?p=74308:LOGIN_DESKTOP:113903018138704:, the application of MasterDetail Claim_Charge. Credentials are of assistance/Viewer.

    Thank you!

    Hello

    Create a new hidden element Px_RUN_MRU and the value of

    Source used "Always replace the value that exists in the session state."

    Source of Type ' static assignment (the value corresponds to the source attribute) ' and

    Value of source or phrase "N".

    Then create new PL/SQL process for tabular and use the code

    if :Px_RUN_MRU = 'N' and :APEX$ROW_STATUS IN('C', 'U', 'D') then
      :Px_RUN_MRU := 'Y';
    end if;
    

    Make sure that this process is captured in the form of process MRU.

    Then change tabular MRU to love affection

    (:request like ('SAVE') or :request like 'GET_NEXT%' or :request like 'GET_PREV%')
    and :Px_RUN_MRU = 'Y'
    

    Kind regards

    Jari

  • Detailed form Master in Apex - creating main records and details at the same time

    I m trying to create a master form / retail.
    The master is a simple standard form and below on the same page there is a tabular presentation containing the details.

    I am facing a problem when you try to save a new record from the master at the same time with new details.
    If I create a new record of the master and at the same time create detail records for this master (on the same page), when I submit that the foreign key of the details field is not filled in. So only one master record gets inserted into the table and record line is not inserted.

    When I have everything first create a master without a detail and edit this master and then add details so everything's allright (since the primary key field is filled out at the time).

    I just need to confirm that whether in the APEX form master detail, can save master and line record at the same time or is it as master must be registered the 1 and then line must be enterd and saved?

    Please let me know, if this functionality can be achieved in the APEX.

    Hello

    There was an error in the process of pl/sql, you referenced f01 (F01. COUNT) in the loop condition and which should have been f03, also you have assigned the wrong field to what should have been P3_DEPARTMENT_ID

    I fixed that. Also, I'm not 100% sure but I think in order to use the table in the column must be of type text or something (and not hidden), but I can't check now because of lack of time.

    A few mistakes during the presentation, but they are still due to constraints on the other fields.

    FOR I IN 1.APEX_APPLICATION. G_F03. COUNTY

    LOOP

    APEX_APPLICATION. G_F03 (I): =: P3_DEPARTMENT_ID;

    END LOOP;

    Concerning

    Bottom

Maybe you are looking for