Populate row of master detail form with selection from LOV?

Hi Guys,
Total noobe, Hope you can help me out with a project I am working on in Oracle Apex 4.1 with 11g XE
I am sure this is a simple enough issue but I just can’t see the solution.
I have a table called ‘STOCK’ this contains all new parts and delivery details.
‘STOCK_ID’ NUMBER PK
‘DELIVERY DATE ‘ DATE
‘PART’ VARCHAR2
‘PART_SN’ VARCHAR2
‘PART_AN’ VARCHAR2
‘INSTALLED’ CHECKBOX
I have a table that list all the current physical locations of hardware for example
ID, Till number, store location etc…
I have an table to list the devices and modification to the hardware in these store locations.
Move Date, Device, Device Serial number, Device Asset Number, Comments
I have a report & form that displays all the current physical locations of hardware and a master detail form linked to this to add devices and modifications to each store location.
I have a LOV setup on the Devices column that is based on a simple select query
SELECT PART from STOCK
ORDER BY 1
This provides me the list of parts in the stock table.
What I need to figure out is how do I get the data from the ‘STOCK’ table when I select a part in the LOV to auto populate ‘DEVICE_SN’ ‘DEVICE_AN’ in my master detail tubular form. this information is contained in the 'PART_SN' & 'PART_AN' columns of the STOCK table.
I also need to figure out how to identify the part because by default the LOV only displays one column and I have no idea which part I am selecting other than by name. i could use a popup LOV and scan a barcode into the search box and get the retuen value to display the part name in the field.
I also would like to reduce the number of records displayed in the LOV by using the ‘INSTALLED’ checkbox i.e. if checked this part has been used and will not be available for selection. The ‘PART_SN’ field can be duplicated as we often get the same part back again as a replacement after repair but this should be valaditated against i.e if the parts is ticked as installed and not available for selection in the list it can be added again this could possibly be validated based on the ‘DELIVERY DATE‘?
I hope this make some sense to you guys if you need any further details let me know.
Cheers
Darren

Hi,
I am from the Oracle Forms background too and I have been using Oracle Apex for a while. Oracle Forms is just like client-server application although it uses the Forms servlet to render its Web front-end. I think...if you're really trying to develop true-Web application, you should try to forget such features as "master with many details" in Oracle Forms. Loading all the details in a single page will cause overheads anyway. When you discover more about ajax and such third-party javascript libraries as jquery and mootools, you'll have a different mind of Web development.
Thanks.
Andy

Similar Messages

  • Master Detail Form with Report - Referring a column in another table

    I have master detail form with a report option. The master table has a column that also references a look up table.
    When the report is displayed the lookup column id is displayed. Rather I want to get the look-up value from a lookup table
    and display in the report.
    When I see the report region Query definition , it just has the columns to add/remove only from the master table.
    Could you pls help me with this regard.
    Eg :
    Dept Table
    dept_id
    dept_name
    location_id
    Employee Table
    employee_id
    employee_name
    dept_id
    location
    location_id_id
    location_name
    Master is Dept, Detail is dept and lookup table is location.

    Simply add the lookup table to the FROM clause and join its PK with the FK in the master table in your query. That's basic SQL, and you definitely must get a good grasp of SQL to do more than very basic work in APEX.
    For a good example, please see http://download.oracle.com/docs/cd/E10513_01/doc/appdev.310/e10498/build_app.htm#BCEBJJGB
    While you're at it, read and implement the tasks outlined in the 2 Day + Application Express Developer's Guide - http://download.oracle.com/docs/cd/E10513_01/doc/appdev.310/e10498/toc.htm. After that, read the "Oracle Application Express 3.0-- Building a Functional Application" OBE in http://www.oracle.com/technology/obe/apex/obe30/apexdev30.htm - great stuff.
    Georger

  • Master Detail Forms with 2 composite primary keys - Is there a workaround?

    Hello All,
    I have been searching for a workaround to the maximum 2 part primary key restriction on the multi-row updates, and master-detail forms, and am hoping that someone can help me. I am using HTMLDB v2.0.0.00.49 with IE 6 against a 9.2 DB.
    I successfully implemented the workaround of Fred Stoopendaal's (see Updata PK on HTML DB ) and it works fine for single page multi-record updateable forms, but alas I haven't been able to extend it to master detail forms (I think it is something to do with Oracle not allowing the "returning" clause on views).
    Here is what I tried:
    two tables, one with a 2 part composite primary key, which is the master table, and a detail table with 3 part composite primary key -
    --------- BEGIN SQL ---------
    create table master_table
    ( master_col1 number
    , master_col2 number
    , master_col3 varchar2(30)
    , constraint master_pk primary key (master_col1,master_col2));
    create table detail_table
    (detail_col1 number
    ,detail_col2 number
    ,detail_col3 number
    ,detail_col4 varchar2(30)
    , constraint detail_pk primary key(detail_col1,detail_col2,detail_col3)
    , constraint master_detail_fk foreign key (detail_col1,detail_col2) references master_table(master_col1,master_col2));
    create or replace view v_master_table as
    select rowid mata_rowid,mata.*
    from master_table mata;
    create or replace view v_detail_table as
    select rowid deta_rowid,
    (select rowid from master_table mata where mata.master_col1 = deta.detail_col1 and mata.master_col2 = deta.detail_col2) deta_mata_rowid
    , deta.*
    from detail_table deta;
    create or replace trigger mata_ins_upd_trg
    instead of insert or update on v_master_table
    referencing new as new old as old
    for each row
    begin
    if inserting then
    insert into master_table (master_col1, master_col2, master_col3)
    values (:new.master_col1, :new.master_col2, :new.master_col3);
    end if;
    if updating then
    update master_table
    set master_col1 = :new.master_col1,
    master_col2 = :new.master_col2,
    master_col3 = :new.master_col3
    where rowid = :old.mata_rowid;
    end if;
    end;
    create or replace trigger deta_ins_upd_trg
    instead of insert or update on v_detail_table
    referencing new as new old as old
    for each row
    begin
    if inserting then
    insert into detail_table ( detail_col1, detail_col2, detail_col3, detail_col4)
    values (:new.detail_col1, :new.detail_col2, :new.detail_col3, :new.detail_col4);
    end if;
    if updating then
    update detail_table
    set detail_col1 = :new.detail_col1,
    detail_col2 = :new.detail_col2,
    detail_col3 = :new.detail_col3,
    detail_col4 = :new.detail_col4
    where rowid = :old.deta_rowid;
    end if;
    end;
    --------- END SQL ---------
    Then I created a master-detail form in Apex on the two views, using the mata_rowid and deta_rowid as primary keys, and mata_rowid=deta_mata_rowid as the link. I realise that using a function to fetch the master rowid within the detail view query is costly, but it was my intention to modify the record fetch queries to use the real FK columns once things were up and running.
    It seems to generate the pages ok, and I can insert/update master table records, but as soon as I modify records in the detail table things go a bit haywire. I can't find any documentation on how the inbuilt MRU/MRD logic works, so can't figure out the issue.
    Can anyone out there tell me what the problem is with the logic above, or if they have come up with a neat solution to this annoying limitation. I know that many will say that I should modify the data model to use surrogate primary keys, but many of the uses for HTMLDB are new interfaces for old schemas, so a workaround that doesn't involve wholesale data model changes would be preferable.
    Thanks in advance,
    Mike Cretan

    Hi, this is likely not the most elegant way...but perhaps the simplest -- and I didn't have much time to play.
    I used Wizard to create two separate Master Detail forms, each with a separate detail table. Thus I ended up with four pages:
    Page "A" - "Selector" page for Master (Report), with Edit link driving to Detail-1
    Page "B" - Editable Master/Detail-1 page (HTML / Report)
    Page "C" - "Selector" page for Master (Report), with Edit link driving to Detail-2
    Page "D" - Editable Master/Detail-2 page (HTML / Report)
    Then I selected the primary key column TWICE on the Report on Page A. Modified the second instance of this column to navigate to Page D (passing primary key) exactly the way the original instance of this column navigates to Page B. Then I deleted Page C.
    Since you can have only one Tabular Entry form per page, this seemed the best way to drive two separate detail tables from a common interface.

  • Master/Detail form with modal edit

    I have a master/detail form that I generated using the wizard that I want to change to have a modal Edit button; i.e. the behavior I want is that the form view is initially read-only and you then have to click an Edit button to make the form editable.
    I figured out how to do this for the master row by making the edit button redirect back to the same page with the request set to 'EDIT' and then making all the page items read-only with a condition REQUEST <> 'EDIT'.
    I cannot find a good way to do this for the detail rows, which are actually a report with editable columns. The problem is that the 'Tabular Form Element' section of the 'Column Attributes' page does not have a read-only condition.
    The only work around I can come up with so far is to have a second read-only report region with the same SQL query and then display either the editable or non-editable report region conditionally depending on whether the request is EDIT. But this obviously not ideal (having same SQL in two places, etc.).
    If anyone can think of a better way to do this, I'd be grateful.
    HTML DB Team: Can you log the addition of a read-only condition attribute on editable report columns as an enhancement request?

    Simply add the lookup table to the FROM clause and join its PK with the FK in the master table in your query. That's basic SQL, and you definitely must get a good grasp of SQL to do more than very basic work in APEX.
    For a good example, please see http://download.oracle.com/docs/cd/E10513_01/doc/appdev.310/e10498/build_app.htm#BCEBJJGB
    While you're at it, read and implement the tasks outlined in the 2 Day + Application Express Developer's Guide - http://download.oracle.com/docs/cd/E10513_01/doc/appdev.310/e10498/toc.htm. After that, read the "Oracle Application Express 3.0-- Building a Functional Application" OBE in http://www.oracle.com/technology/obe/apex/obe30/apexdev30.htm - great stuff.
    Georger

  • Master - Detail Form with multiple children

    Hi,
    I have managed to create a Master - Detail form in APEX with 2 child tables. For evey parent it brings back the associated child records from the
    2 tables in 2 regions.
    I am having a problem with the Add Row buttons. I copied the button from region 1 ( child 1) to region 2 (child 2). Re-named them (AddRows2).
    When I hit hit Child2 Add Rows, it adds the row to Child 1 region. I suspect it's got something to do with the MRU Process, so I created another
    one called MRU2, based on button Addrows2/ Child table 2. Seems logical, but it still creates the new record in Region 1 ( Child 1).
    Any ideas or examples,
    Thx.

    Hi,
    I am from the Oracle Forms background too and I have been using Oracle Apex for a while. Oracle Forms is just like client-server application although it uses the Forms servlet to render its Web front-end. I think...if you're really trying to develop true-Web application, you should try to forget such features as "master with many details" in Oracle Forms. Loading all the details in a single page will cause overheads anyway. When you discover more about ajax and such third-party javascript libraries as jquery and mootools, you'll have a different mind of Web development.
    Thanks.
    Andy

  • Master-Detail Forms with read-only data in Master

    I have a Master-Detail form created in Portal in which the master has fields that have select access (this has corporate bio/demo data) with the detail section having full access (local data).
    When I go to create the form, it will not compile since it generate a DELETE code on master records.
    The view I have has a master corporate record with people in depts adding detail records.
    I am running Portal 3.0.9.

    Hi,
    This is a bug. The only workaround would be is to write your own custom event and write your own code to do all that is done in onsave.
    Thanks,
    Sharmila

  • Error "field required" in master-detail form with FORMS 10G!!

    I have a Master-Detail Form.
    When the cursor stay in detail block and i chage the master record with the mouse, clicking in scroll bar, i get error "field required".
    In Forms 6i, works fine!!

    Master block has more than one record displayed. When I click on any item in detail (except first one) and then click on different master record (return navigation to master block, but not current record) I have FRM-40202: Field must be entered on first item in detail block.
    I found that reason is this part of clear_all_master_details procedure (automatically created by Oracle Forms):
    IF :System.Cursor_Item <> startitm THEN
    Go_Item(startitm);
    Check_Package_Failure;
    END IF;
    Does any have same experience?
    Is it Oracle bug or I am missing something?

  • How to display more rows in Master-detail form

    I am working on APEX3.2.
    I have a master-detail form. The detail form always display 15 rows. However, my customer wants the detail display all the rows. I tries to configure the Number of Rows in the report. It doesn't work. How do I do it?
    Thanks a lot!

    Hi:
    To increase number of rows displayed you have to set Number of Rows and pay attention to both Number of Rows (Item) and Maximum Row Count.
    After that if didn't work, sign out or close the browser then open it again. Sometimes it keeps the value in current session.
    Saad,

  • How to access detail-rows in master-detail form?

    I have a master-detail form(one to many relationship). The master and detail are in separate blocks. The detail rows are displayed in a tabular form.
    I need to access the detail-rows since the database writes for the detail rows will be managed by a procedure.
    I have been looking through the documentation and have been unable to find any syntax for iterating through the detail-rows.
    Any help is appreciated. Thanks.

    go_block(detail)
    first_record;
    in a loop while not last_record
    -- do your stuff
    next_record;
    end loop;

  • About having multiple blank  rows on master detail form

    Can I have multiple blank rows on detail form when I create master detail form?
    please help me
    shuyue

    Let me answer my own question.
    Set the number of rows to 500 and it will dynamically set to the number of rows.

  • Insert new row to master - detail form using bindingsource

    Hi all,
    I have a form to analyse price of product, the form include master (textbox:slip ID,datetimepicker : date) and detail(datagridview:slipID,productID,price..)
    When I insert new row as below code, all inserted to DB but not show on form, I must close and reopen the form the new row will show, how i must to do to fix it 
    please help, thanks
    Select data when form load 
    ds = New DataSet
    damaster = New SqlDataAdapter("select soPTG,ngaybd,ngaykt,khoa = case when sttesign =0 then 'True' else 'False' end from tbl_PTGMaster", conn)
    damaster.Fill(ds, "tbl_ptgMaster")
    dadet = New SqlDataAdapter("select [SoPTG],[Mahang],[gianhap],[thuesuat],[laigop],[giacu],[giamoi] from tbl_PTGDetail", conn)
    dadet.Fill(ds, "tbl_ptgdetail")
    ds.Relations.Add("PTG_rel", ds.Tables("tbl_ptgmaster").Columns("SoPTG"), ds.Tables("tbl_ptgdetail").Columns("SoPTG")).ChildKeyConstraint.UpdateRule = Rule.Cascade
    BindingMaster.DataSource = ds
    BindingMaster.DataMember = "tbl_ptgmaster"
    BindingDetail.DataSource = BindingMaster
    BindingDetail.DataMember = "PTG_rel"
    gridchitiet.DataMember = "tbl_ptgdetail"
    txtptgnumb.DataBindings.Add("text", BindingMaster, "soPTG")
    dtstart.DataBindings.Add("Text", BindingMaster, "ngaybd")
    dtend.DataBindings.Add("Text", BindingMaster, "ngaykt")
    cmdlock.DataBinding.Add("Enabled", BindingMaster, "khoa", True, DataSourceUpdateMode.OnPropertyChanged)
    setStatus()
    SetHeader()
    Dim cmdinsert As New SqlCommand("insert into tbl_PTGMaster(SoPTG,ngaybd,ngaykt) values(@SoPTG,@ngaybd,@ngaykt)", conn)
    cmdinsert.Parameters.Add("@soPTG", SqlDbType.Char, 10).Value = txtptgnumb.Text
    cmdinsert.Parameters.Add("@ngaybd", SqlDbType.DateTime).Value = dtstart.Value
    cmdinsert.Parameters.Add("@ngaykt", SqlDbType.DateTime).Value = dtend.Value
    damaster.InsertCommand = cmdinsert
    damaster.FillSchema(ds, SchemaType.Source)
    cmdinsert = New SqlCommand("insert into tbl_PTGDetail(SoPTG,mahang,gianhap) values(@SoPTG,@mahang,@gianhap)", conn)
    cmdinsert.Parameters.Add("@SoPTG", SqlDbType.Char, 10).Value = txtptgnumb.Text
    cmdinsert.Parameters("@SoPTG").Direction = ParameterDirection.InputOutput
    cmdinsert.Parameters.Add("@mahang", SqlDbType.Char, 10, "mahang")
    cmdinsert.Parameters.Add("@gianhap", SqlDbType.Decimal, 8, "gianhap")
    dadet.InsertCommand = cmdinsert
    dadet.FillSchema(ds, SchemaType.Source)
    gridchitiet.FinishEditing()
    BindingMaster.EndEdit()
    damaster.Update(ds, "tbl_PTGMaster")
    ds.Tables("tbl_PTGMaster").AcceptChanges()
    BindingDetail.EndEdit()
    dadet.Update(ds, "tbl_PTGDetail")
    ds.Tables("tbl_PTGDetail").AcceptChanges()
    BindingMaster.ResetBindings(False)
    BindingDetail.ResetBindings(False)

    Hello,
    The base idea here is if the record is added successfully you would then get the new primary key then manually add the record to the underlying data source. Does not matter if we are talking a single table or a master-detail setup.
    The following shows the basics
    https://code.msdn.microsoft.com/Adding-new-records-into-bff5eaaf 
    All of the above is done without using a DataSet yet the same thing needs to happen with a DataSet, simply focus on the one table.
    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem.

  • Add Row in Master Detail Form

    Hi all,
    I wonder if there is a way to just Add Row in the master detail (tabular) form without actually submitting the page. So if user has updated any existing row before clicking the Add Row button, the update should not be submitted by Add Row button click. If this is possible, then I want to submit (insert) the newly added row as well as any updates made to the existing rows when user click the "apply changes" button.
    Any luck?
    Thanks for the help.
    Milaan

    Hi Andy,
    Thanks for your response. Here is what I am doing... On submit I am calling another page (popup) for user to enter electronic signature. So when they add row (which is a submit), it calls the electronic signature page popup, and only upon entering the signature (nuisance at this point) it adds a row in the tabular form. Is there a way to change this behavior to not to submit the page every time user click Add row button?
    Thnx
    Milaan

  • Number of Rows on Master - Detail Form

    I want to dynamically display the number of detail rows.
    I can get the number of rows to be displayed by entering this PL/SQL code before displaying the page:
    declare
    cnt number;
    begin
    SELECT count(*) into cnt FROM table WHERE client = "Ford";
    end;
    How do I tell the 'Number of Detail Rows to Display' field on the 'Options for Detail Row' page to use this value?

    Let me answer my own question.
    Set the number of rows to 500 and it will dynamically set to the number of rows.

  • How can I pre-populate a web app input form with data from a webform in the CRM?

    Scenario:
    A customer fills a registration webform. The customers data is stored in BC CRM as usual. This step provides a lead to marketing unit and the team makes a follow up. Upon completion of internal processes. The workflow initiated by this customer filling the registration form is approved.
    Th user is sent a 3rd-party notification with a url to enable the user complete the registration process by entering the information into a web app.
    The Issue:
    The client is requesting that he doesn't want the the customer to re-enter some of the  information that  has been captured in the registration form again since it will be laborious for the user to do this. He wants the system to store this customer data already in the CRM and pre-fill the web app form so that the user just submit the data, so that the item can be in the appropriate web app as web app item.
    Question: Is this possible? Can this be achieved via js. How should I go about it.
    Your assistance will be appreciated.
    Thanks.

    For each option you would need to only have a custom text field for that item. This is where the otpion for each gets populated with javasript.
    Each option is your own html that is a select with options as web app items. A list layout of your web app items is just a select with text and value of that item.
    Your tricky thing is to setup the matrix of rules to define what shows and when. You can do that with data source association between web apps if it is a 1-1 relationship but if it is 1 to many you need to form script matrix to define what happens on each change.
    It depends on the details but thats the core of it.

  • Master Detail Form - How 2 update a field in the Detail form using a query?

    Hello,
    I have a master detail form with, each master record having a fixed(6) number of detail records. One of the fields in the detail record is the PART_DESCRIPTION field. I am trying to update this field by querying Table_X. TABLE_X is in the format of (desciption id, description). Description id runs from 1 to 6.
    When the form displays, the PART_DESCRIPTION field for the 6 detail records needs to be automatically populated with the six values of description stored in Table_X. How can this be done?
    Tried using session storage objects, but made no headway.
    Would greatly appreciate pointers on how to go about doing this.
    Thanks.
    Dev

    If you are on a Portal Version lesser than 3.0.9.8.3, then please try the following to populate
    the PART_DESCRIPTION field.
    Steps:-
    1> Edit the form and go to the Additional PL/SQl section and put the following code in the
    "...after displaying the page area" :-
    declare
    type t_vc_arr is table of varchar2(4000) index by binary_integer;
    l_arr_desc t_vc_arr;
    l_form_name varchar2(200);
    l_form_state varchar2(500);
    begin
    l_form_name := p_session.get_module().get_name();
    l_form_state := p_session.get_value_as_varchar2(
    p_block_name => 'MASTER_BLOCK',
    p_attribute_name => '_FORM_STATE'
    if l_form_state = 'QUERY_AND_SAVE' then
    select description
    bulk collect into l_arr_desc
    from <schema>.table_x;
    htp.p('
    <script>
    var descArr = new Array();
    var Fidx = 1;
    var formObj = document.WWVM'||p_session.get_id()||';
    var fieldName = "'||l_form_name||'.DETAIL_BLOCK.PART_DESCRIPTION.0";
    for i in 1..l_arr_desc.count loop
    htp.p('descArr['||to_char(i-1)||']="'||l_arr_desc(i)||'";');
    end loop;
    htp.p('
    for (var i=0; i < formObj.length; i++){
    if (formObj.elements.name == fieldName+Fidx){
    formObj.elements[i].value = descArr[Fidx-1];
    ++Fidx;
    htp.p('</script>');
    end if;
    end;

Maybe you are looking for

  • Report On Vendor Master

    Hi All, I need to know if there is some standard report availbale in SAP on Vendor Evaluation, where i can check all parameteres related to Vendor's Performance. thanks & regards, Prashant Rathore.

  • Do you store IDE-specific files in your repository?

    Hi , In [Continuous Integration|http://martinfowler.com/articles/continuousIntegration.html] , The author state that "You must put everything required for a build in the source control system, however you may also put other stuff that people generall

  • I found the answer to my question where are the file, edit tools, etc menus

    == Issue == I have another kind of problem with Firefox == Description == file, tool, edit menus can be found by hitting the alt key == Firefox version == 3.6.3 == Operating system == Windows XP == User Agent == Mozilla/5.0 (Windows; U; Windows NT 5.

  • Address Book - Can't add Notes

    Using 10.5.3 I can't add Notes to my address book cards either in Edit mode or not in Edit mode. The word "Note" is grayed out and I can't type in the field. What am I missing? I feel like I am doing something wrong. Thanks for any suggestions.

  • Transportation zone can't be change in Customer Master

    Hi Guys, I have a question regarding changing the Transportation zone in Customer Master. This area is being greyed out as I cannot change it. Even if I extend the Customer,  the field for Transportation zone is greyed out. My question is, how can I