Master- Detail form, Total column in master block.

Hi all,
i have a invoice_master,block with the flowwing column inv_no,inv_date,inv_total.
and int he invoice_details, i have item_code,price,qty,total. i have to get SUM(total) into invoice_master.inv_total. inv_total i want to be a display item but database item.
which is the best way to get sum(total) into invoice_total. i tried with pre-insert on the invoice_details. some times it is not ok, when i do ay updations on details blocl etc.
Thanks in advance.

hi,
What euginy has suggested is one good way.
The other way is to create a non-database item(lets say 'x') in detail block with number of items displayed property=1,calculation mode=summary,summary function=sum,summarised block=<invoice_details>,summarised item=total and the property of block <invoice_details> Query all records='YES'.
Then make the property ,copy value from item ,equal to 'x',of invoice_total field of invoice master.
Cheers
Rajeev

Similar Messages

  • Hi  cant see the primary key column in master detail  form

    I have a master detail form .In the first master form i am unable to see the primary key
    Now the form is built completley and i also will like to see the primary key column visible in master report
    If i had set the primary key as rowid then i could have seen the primary key ..
    Now i can see the pencil icon (The eidt row pencil icon) instead of the actual primary key column . .which is a number data..
    I will like that too be visible ..Can any one guide what should i do for this..
    Thanks

    Hi Mat,,
    I am using apex 4.2 db version 11g and in the first master page i had set the value of combo which is primary key column as text
    But still iam not able to see the number ..Note if i recreate the form ..with rowid as primary key i am able to see the column since the pencil icon(edit icon) is on row id..
    Currently All i see is the edit icon ..I need both the edit icon and also the number ..
    Thanks

  • Primary key updation in the Master details form.

    Hi All,
    I am struggling with Master Detail form in apex 3.12.
    I have two tables.
    SaleMaster ( TRN_ID as PK ) Created from Sequence.
    SaleDetail ( TRN_ID , TRN_TYPE as PK) TRN_ID FK from SaleMaster , TRN Type is user Input in SaleDetail.
    What is best simple way to create the master details form for the above master details tables.
    Thanks.

    I found a way. I dont like it - but it works.
    I made a column link in the detail with the following:
    javascript: doSubmit('NAVIGATE@#ROWNUM#);
    This way I obtain information in the :REQUEST object about which row was clicked.
    In a After submit process on the page I then parse this :REQUEST object like this:
    DECLARE
    v_row NUMBER;
    v_pos NUMBER;
    BEGIN
    v_pos := instr(:REQUEST,'@',-1);
    v_row := substr(:REQUEST, v_pos+1);
    IF APEX_Application.g_f02(v_row) IS NOT NULL THEN
    :P_PRIMARY_KEY_ID:= APEX_Application.g_f02(v_row);
    ELSE
    :P_PRIMARY_KEY_ID:= -1;
    END IF;
    END;
    I know that my "Id" column is named f02 in the form, so this way I can find the id. I then assign this id to a kind of global variable - on the page I redirected to I can now find the Id.
    Talk about ugly code :P

  • 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

  • Inconsistent inserts into detail table of master-detail form

    Hello,
    [I am not sure if this is a bug or user error, so I've also put this in the bug tracking system.  Apologize for the 'duplication']
    I have a master-detail form: Orders is the master, and Order_Details is the detail. I have noticed some inconsistent behavior when inserting the detail information.
    On occasion, the row will be inserted, and a null value will get inserted into the database for the first column of the detail table; all the other data values will be inserted fine. There doesn't seem to be any pattern to when it happens. I wrote down the following test steps:
    1. Enter new order information and click 'Create'
    2. Click 'Add Row' button so can add order detail info
    3. Enter detail row information
    4. Click 'Add Row' (I do this so I can see the success message that the detail data was actually inserted)
    5. Click 'Apply Changes' at the master level.
    I ran a query on the order details table and saw that the data inserted correctly. Then I ran the following test:
    1. Enter new order information and click 'Create'
    2. Click Add Row button so can add order detail info
    3. Enter detail row information
    4. Click 'Add Row' (success message appears that detail was inserted)
    5. Enter second detail row information
    6. Click 'Add Row' (success message appears that detail was inserted, however, now in the first column of that second detail row - the product name field/column - the data does not appear. I only see my null text value. The data in the first detail row is all correct)
    7. Enter third row detail information
    8. Click 'Add Row' (success message appears that detail was inserted, and this row's information appears correctly, as does the first row's, but the second row is still showing a null value for the product name column)
    9. Click 'Apply Changes' to get out of the form
    A query of the order details table shows that a null value (-) has indeed been inserted into the table for the product name column of the second detail row.
    This behavior also happens when I don't have a null value for the LOV (i.e., it defaults to the first row of the lookup table).
    Has anyone seen this before? Am I entering the data incorrectly?
    Thanks.
    -melissa
    Message was edited by:
    mblakene

    having the some problem. Any help with this ??
    milowski were you able to solve it ? can you share the information.
    Thanks

  • Master/detail form - Detail columns lack help information

    I have a master/detail form. All the fields in the master block have help information attached to assist the user when entering data. The detail block, which is more of a multi-row based block, has column headings along the top. However, no where can I insert "help" text for these particular columns. Although self explanatory, it still would be nice to be able to incorporate "help" text for these columns. Am I missing something? Can this be done? I've thought about a button on top of the region which could call an html page with help for these columns, it just seems to be a "rougher" solution than whats available to the individual fields in the master block.

    Hi,
    Nope, you're not missing anything - there is no Help functionality. This is probably because the Help on page items is available for "Labels", which do not exist for tabular forms, which are based on a report structure.
    You would, if you wanted, update the heading to include a "tooltip":
    Instead of, for example:
    HiredateYou could enter:
    &lt;span title="Enter the employee's hire date"&gt;Hiredate&lt;/span&gt;It should also be possible to mimic the popups you get for page items if that is what you need
    Andy

  • Master-Detail-Form; Hide/Show columns in detail form depending on column

    Hi,
    i have a master detail form. In the detail form i have the columns:
    ID, MASTER_ID_FK, PC_SOURCE, A_C1, A_C2, A_C3, B_C1, B_C2, B_C3
    The Column PC_SOURCE should be a LOV with values
    NULL
    A
    B
    So if i choose or enter a master record the detail form appears and i can enter one or more detail records.
    PC_SOURCE is the first column.
    If i choose A, the columns B_C1, B_C2, B_C3 should disappear as there should no entry possible.
    If i chhose B, the columsn A_C1, A_C2, A_C3 should disappear as there should no entry possible.
    Is that possible?
    I tried a little on my own but without success. I tried to put into the first column (PC SOURCE lov) in Element Attributes a javascript call like onChange="do_Refresh('#PC_SOURCE#');"
    The javascript funktion do_Refresh tries to catch the column value and set a hidden item P1_SOURCE like document.getElementById('P1_SOURCE').value = v_source;
    But this does not work, as there is not the value of the column fetched.
    And probably can´t work because of the more than one detail rows.
    Thanks & regards,
    Matthias

    Hi,
    The html for your detail form will be a table of input elements with names f01,f02,etc. The columns for the key fields are normally hidden so your PC_SOURCE column will probably use the name f03. The name for column A_C1 will be f04 etc.
    Once you have the input names for your columns you can create a dynamic action (DA) to hide the elements you want.
    You want the DA to fire when any PC_SOURCE element is changed so you want the when to be:
    Event: Change
    Selection Type: jQuery Selector
    jQuery Selector: input[name="f03"]
    Condition: no condition
    The action is to hide an element in the same row if the changed element is a value. So the action should be:
    Action: Execute JavaScript Code
    Fire when Event is: true
    Code: if(this.triggeringElement.value=="A"){$x_Hide('f04_'+this.triggeringElement.id.split('_')[1])}
    You then need lots of true actions for each element you want to hide.
    Rod West

  • 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

  • FRM-40654 error in master-detail form while deleting record in detail block

    Hi,
    I am facing an issue in a custom form which is a Master-detail form while deleting a record in detail block. It is giving an error "FRM-40654 Record has been Updated by another user. Re-query to see change". I have checked the record is matching with that in database.
    Can anyone help on this.
    Thanks In Advance,
    Midhun

    Hi jan,
    master block is based on Table "A" and detail block is based on a View "X".
    View "X" definitions includes the tables "A","B","C" etc..
    Now I have tried removing table"A" from view "X", even then the same error is ocuuring but the lock is happening on table "B" instead of "A"
    Thanks,
    Midhun

  • Updating columns in master/detail form

    Changes were made to the database that is in the master part of a master/detail form. I have tried to add the new fields using "Create Item" on the page definition.
    I have gone through the wizard and set the source items to:
    Source Used: Always
    Source Type: Database Column
    Session State: per session
    Source Value: AppsDependentOn (the name of the newly added field)
    It seems that the form will not display the new column - it does display the label and a blank textfield. I have no problem adding columns to the detail part of the form.

    "197331",
    For Source Value, try uppercase instead: APPSDEPENDENTON
    Sergio

  • Master Details form (LOV based on Detail Column of Join Condition)

    I have created a master detail form where user_id is joining master and details.
    I have created one dynamic lov based on child user_id in detail block to diplay all user who works under current user.
    Problem : When i want to select Insert detail action in detail block the dynamic lov should read the user_id which is going to be inserted when you press Save button. Means as its not getting populated till one click on save button my lov is not getting refereshed.
    Please advice what should i do.
    Thanks
    Bakulesh

    I solved myself by modifing some guru's script from this forum little bit. I am adding here for feedback or use to any.
    htp.p('<script language="JavaScript1.3">
    function getMstFieldValue(form,fieldName)
    var objName = "";
    var tmp = "";
    var dAction = "";
    var sel_idx = 0;
    var cnt = 0;
    var instance = 0;
    var slicedName;
    var fillData = new Array();
    var blkname;
    for(var i = 0; i < form.length; i++)
    slicedName = form.elements.name.split(".");
    tmp = slicedName[2];
    instance = parseInt(slicedName[3],10);
    blkname = slicedName[1];
    //alert("Fld "+tmp+" blk "+blkname+ " instance "+instance);
    if (!tmp)
    continue;
    objName = tmp;
    if (objName == fieldName && blkname == "MASTER_BLOCK")
    return form.elements[i].value;
    function setDetFieldValue(form,fieldName,value)
    var objName = "";
    var tmp = "";
    var dAction = "";
    var sel_idx = 0;
    var cnt = 0;
    var instance = 0;
    var slicedName;
    var fillData = new Array();
    var blkname;
    for(var i = 0; i < form.length; i++)
    slicedName = form.elements[i].name.split(".");
    tmp = slicedName[2];
    instance = parseInt(slicedName[3],10);
    blkname = slicedName[1];
    //alert("Fld "+tmp+" blk "+blkname+ " instance "+instance);
    if (!tmp)
    continue;
    objName = tmp;
    if (objName == fieldName && blkname == "DETAIL_BLOCK")
    form.elements[i].value = value;
    </script>');
    thanks
    Bakulesh

  • Limit on number of columns details of a master detail form/report

    Hi,
    I understand that there is a limit to the number of columns you can have in a master detail form/report. I am on Apex 4.01 and have a detail section that shows 24 months at a time as columns with integer hours assigned each month. My master detail was working fine with as many as 24 months/columns in this detail section, but I tried to re-use months by 'recycling' months, clearing them out of values and adding the months to the end of each row but now I am getting errors even though I had more columns showing before my 'recycliing' of the columns. The error is:
    "ORA-06502: PL/SQL: numeric or value error: character string buffer too small "
    What I don't understand is -- why am I getting this error now when I actually had more columns in the detail section months ago, and all I am doing is 'recycling' prior columns back into the detail report, not actually adding columns.
    Thanks for any insights anyone can give.
    Pat

    DBA tells me that we are at 9.0.2.2.14, (higher version than the one you suggested) but I still get the same error.
    Thanks,
    Karuna

  • Master Detail Form - Update Statement for Column in the Detail Section

    Hello,
    I've posted a demo application to apex.oracle.com
    Application# 49298
    Application Name: Street_Inventory
    Basically, on page 3 I have a Master Detail Form. In the Detail section, I want the value of On_hand to save to table ITEMS. Here's my code below.
    SOURCE
    select
    "CONSUME_DETAIL"."CONSUME_DETAIL_ID",
    "CONSUME_DETAIL"."CONSUME_HEADER_ID",
    "CONSUME_DETAIL"."ITEM_ID",
    "CONSUME_DETAIL"."CONSUMED_QUANTITY",
    ("ITEMS"."ON_HAND" - "CONSUME_DETAIL"."CONSUMED_QUANTITY") as "ON_HAND"
    from "CONSUME_DETAIL",
    "ITEMS"
    where "CONSUME_HEADER_ID" = :P3_CONSUME_HEADER_ID
    and "CONSUME_DETAIL"."ITEM_ID"="ITEMS"."ITEM_ID"
    UPDATE INVENTORY PROCESS
    UPDATE ITEMS
    SET ON_HAND = :P3_ON_HAND - :P3_CONSUMED_QUANTITY
    WHERE ITEM_ID = (select     ITEM_ID
    from     CONSUME_DETAIL
    where CONSUME_DETAIL_ID = :P3_CONSUME_DETAIL_ID);
    My code isn't working. What am I doing wrong?

    WReed,
    The first thing I see "off the bat" is that you don't have items named P3_ON_HAND and P3_CONSUMED_QUANTITY which are referenced in your code. Although it's possible to do what you want with just SQL, I updated your code with a little PL/SQL to make it easier to understand...
    As you'll see the problem now is that the design/db model is not quite right as your getting a too many rows error.
    Regards,
    Dan
    http://danielmcghan.us
    http://sourceforge.net/projects/tapigen

  • To get value in detail part of master detail form

    hi all
    i am using forms 6i
    there is a master detail form
    in the master part
    i am just mentioning one field as per the requiremnt
    FIELD BELONGS TO DATA BLOCK XXNP_JL_001.FIELD
    this FIELD field is populated by a flexfield NAP_GL_WELL
    VALUES are
    abc                           123
    def                            456
    fgh                            875
    in the master part of the form there is also a button called POPULATE which populates values  for the fields in the detail form
    in the detail part of the form
    i am mentioning two fields
    item_number belongs to data block XXNP_JL_EST_002 and      opn_value belongs to data block XXNP_JL_RES_005
    now the requiremnt is as follows
    say the WELL field has a value 'abc'
    then in the detail part
    whenever and only when the item_number is '1010103002' the opn_value field should have value 123
    similarly when the WELL field has a value 'def'
    in the detail part
    when the item_number is '1010103002' the opn_value  field should display value '456'kindly guide on how this can be achieved
    thanking in advance
    i did a when validate trigger on opn_value field
    BEGIN
    IF  :XXNP_JL_RES_005.OPN_UOM_CODE='PKU' and :XXNP_JL_EST_002.ITEM_NUMBER='1010103002' THEN
            SELECT hierarchy_level
            INTO :XXNP_JL_RES_005.OPN_VALUE
            FROM fnd_flex_values
            WHERE flex_value_set_id = 1009757
            AND FLEX_VALUE=:XXNP_JL_001.FIELD ;
            END IF;
            END;Edited by: makdutakdu on Jul 4, 2012 12:40 PM
    Edited by: makdutakdu on Jul 4, 2012 1:05 PM
    Edited by: makdutakdu on Jul 4, 2012 1:09 PM

    HI
    If i understood your question on overview, your requirement is
    get master details in details column.
    If this is correct,
    YOu can write a simple plsql to get master value in details columne thru trigger
    If my understanding is not correct, please tell me

  • Primary key in master detail form

    i have a situation where i need to access the value of primary key (primary key is hidden) in a master-detail form.
    i need to access the primary key in the javascript onClick event of the button. i'm using the following code in the ...before displaying the form event :-
    htp.p('<script language="JavaScript1.3">
    <!--
    function getField(form,fieldName)
    var objName = "";
    var tmp = "";
    var dAction = "";
    var sel_idx = 0;
    var cnt = 0;
    var instance = 0;
    var slicedName;
    var fillData = new Array();
    for (var i = 0; i < form.length; i++)
    slicedName = form.elements.name.split(".");
    tmp = slicedName[2];
    instance = parseInt(slicedName[3],10);
    if (!tmp)
    continue;
    objName = tmp;
    if (objName == fieldName)
    return form.elements[i].value;
    //-->
    </script>');
    and then i'm calling this javascript in onClick event of the button as follows :
    var_get_val = getField(this.FORM,'PROD_ID');
    this script works for a form with single block but, does not work with the master detail form.
    what is wrong here ... ??
    any ideas or suggestions ...??
    thanx a lot.
    null

    Thank you, Denes,
    but isn_t there a simplier way to use a third column ?
    I will keep your idea in mind and try out as soon as possible.
    With kind regards,
    Hergen.

Maybe you are looking for

  • Check for wifi and 3g connection

    I'm using the following code to check for a network connection. This seems to work fine with wifi, but I also want it to work if I only have 3G connection. How can I do this? Boolean success; const char *host_name = "www.domain.com"; SCNetworkReachab

  • Firefox hangs up on download on Mac OS 10.9.2.

    I got a notification to download the latest version of Firefox, but it hung up partway though. I went on line for info and was advised to trash the old version and download a new version. That still doesn't download. Now what?????????

  • Graphics legend colors

    Does anyone know how to customize the colors displayed in a graphics legend. I've created a column chart with customized bar colors by using a format trigger and using og_set_fillcolor. But my legend doesn't reflect these custom changes. Is there an

  • IPod function / standby bug?

    I'm not sure if this is my fault, or the phone's, but since I can't find any settings relating to it. Sometimes when my phone goes into standby (i.e. the display shuts off and it locks) it starts playing whatever the 'now playing' song is in the iPod

  • I just upgraded to mac osx 7 and my speakers do not work

    I just upgraded to Mac OSX7 and now neither my internal or external speakers work.  Anyone have a suggestion?  I've already reviewed the settings and they appaer normal.