Portal Master-detail form how to auto assign detail record sequence number

Portal Master-detail form how to auto assign detail record sequence number.Please help me?

You can just read the following section
Can I specify a sequence number generator as the default value for a form column?
Yes. Enter the following in the "default value" field for the column:
#<schema name>.<sequence name>.nextval
where <schema name> is the name of the schema containing the sequence, and <sequence name> is the name of the sequence. The entry is preceded by a "#".
For example, if the schema name is "SCOTT", and the sequence name is "CUSTOMER_SEQ", the default value entry is:
#SCOTT.CUSTOMER_SEQ.NEXTVAL
same way you can do for master - detail form.
for more information on forms please refer the following URL.
http://otn.oracle.com/products/iportal/htdocs/portal_faq.htm#BuildingApplications
hope it helps.

Similar Messages

  • Form - how to auto update details & check another table as well

    I have two tables : empinfo(all basic details of emp) and leaves(empid,empname,date etc)
    I have a clanedar that displays the leave info and when i click on the date it loads a form that makes new entry to the leaves table ....
    There are two things it should do : 1. autp populate details on the form when they enter empid i.e empname,email etc should be picked from main table and load on form (how do I achieve this??? ) sql...pl/sql...any guidance will be appreciated.
    2. when the emp has entered a leave it should check on another table for any shortage of particular skills(table has skill,empname,empid,min_emp_skil (number) )
    how or what should be done to check this details and action accordingly.
    Please help.

    Start here http://docs.oracle.com/cd/E23903_01/doc/doc.41/e21674/bldapp_frm.htm#BCEBEDIC
    By the time you understand create the form on a table, you will automatically learn how to add validations on that page or even a plsql process before the actual form DML runs
    Thanks

  • How to prevent a new record sequence number to be created for a period of 14 days

    ALTER proc [dbo].[spCreateSequenceContainerFill]
    (@containerID as nvarchar(64),
    @lotNum as bigint,
    @customerID as int = 1164,
    @productID as int,
    @fillDateTime as datetime
    as
    BEGIN
    declare @checkcontainerID as bigint
    DECLARE @ID int;
    set nocount on
    SELECT @checkcontainerID = CONVERT(bigint, SUBSTRING(@containerID, 1, 6)) FROM ContainerFillHistory WHERE containerID = @containerID
    IF (@checkcontainerID is null)
    SELECT @ID = COALESCE((SELECT MAX(ID) + 1 FROM ContainerFillHistory), 1)
    ELSE
    SELECT @ID = Max(ID) FROM ContainerFillHistory WHERE containerID = @containerID AND @fillDateTime >= DATEADD(DAY, 14, CAST(fillDateTime as DATETIME))
    IF (@ID is not null)
    SET @ID = @ID + 1
    INSERT INTO ContainerFillHistory(ID, containerID, lotID, customerID, productID, fillDateTime, purchorderNum)
    VALUES(@ID, @containerID, @lotNum, @customerID, @productID, @fillDateTime, null)
    END
    If there is a no record with an ID then a new record is created and inserted in the table.  After 14 days it is OK to add another record with that ID and bump up the sequence number of the total records in the table.  Handling the non existing
    case the first time is OK, but the restriction of 14 days if a new record is trying to be inserted has to be ignored.
    So far I have this TSQL code.

    Please try the following and tweak accordingly.
    ALTER proc [dbo].[spCreateSequenceContainerFill]
    (@containerID as nvarchar(64),
    @lotNum as bigint,
    @customerID as int = 1164,
    @productID as int,
    @fillDateTime as datetime
    AS
    BEGIN
    SET NOCOUNT ON;
    DECLARE @ID int;
    IF EXISTS (select * FROM ContainerFillHistory WHERE containerID = @containerID)
    BEGIN
    SELECT @fillDateTime = DATEADD(DAY, -14, @fillDateTime)
    IF EXISTS ( SELECT *
    FROM ContainerFillHistory
    WHERE containerID = @containerID
    AND CAST(fillDateTime as DATETIME) > @fillDateTime --AND @fillDateTime >= DATEADD(DAY, 14, CAST(fillDateTime as DATETIME))
    BEGIN
    RETURN; --//14 Days condition not met
    END
    ELSE
    BEGIN
    SELECT @ID = Max(ID) FROM ContainerFillHistory
    WHERE containerID = @containerID
    AND CAST(fillDateTime as DATETIME) <= @fillDateTime
    END
    END
    ELSE
    BEGIN
    SELECT @ID = MAX(ID) FROM ContainerFillHistory ;
    END
    IF @ID IS NULL
    BEGIN
    SET @ID = 1 ;
    END
    ELSE
    BEGIN
    SET @ID = @ID + 1 ;
    END
    INSERT INTO ContainerFillHistory(ID, containerID, lotID, customerID, productID, fillDateTime, purchorderNum)
    VALUES(@ID, @containerID, @lotNum, @customerID, @productID, @fillDateTime, null) ;
    END

  • Master-Detail Form (How to pass an item value in Master to Detail field

    I have a Master-Detail form. When adding a new record in the Detail section, I expect the primary key in the master record will copy down to the detail record. But, it is not doing that. Does anyone know how to pass the master primary key down to the detail record field.
    By the way, query works fine. It knows the master-detail relationship. It is just when creating a new detail record, the key not pass down from the master record.
    thanks - Patty

    hi,you can do it by:in detail form's foreign key field,set it's default value as master primary key ,example master page p1,primary key as p1_master,detail form p2,foreign key p2_foreign, set p2_foreign key 's default value &p1_master.
    Message was edited by:
    lixinzhu

  • How to set Assignment details in RSBBS

    Hi Experts,
    RRI is used in dev.I want to know how to set assignment details.What's the meanning of
    Type ,selection type and required entry? pls be more specific.Thank you.
    Best regards,
    Gavin

    <b>Look at</b> ...explained wid examples
    http://help.sap.com/saphelp_nw04/helpdata/en/a2/9b548d979de04180d15b5a55aa94aa/frameset.htm
    Post back for any further questions ...

  • 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;

  • Master/Detail Forms - How to go directly to detail?

    The things you forget when you haven't used them in a while.
    I have two tables:
    MASTER with a MASTER_ID
    DETAIL with a DETAIL_ID and MASTER_ID (foreign key back to master based on MASTER_ID)
    When I generate the form using the wizard, how do I get the MASTER_ID on create so that I can immediately start adding the detail after creating the master (without having to go back to the report and select "Edit" (which works).
    Basically, what I am asking is: How do I get the MASTER_ID sequence value(key) generated at INSERT populated in a form variable so that I can move straight to adding detail lines?
    Thank you
    --Too Sleep Deprived to think this through.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    Both Seattle City Light (SPU) and the Seattle Police (where I work) are now using APEX. I actually love it as a development language (except for some of the page formatting issues which I deal with from time to time). We are "killing" all of our ACCESS 97 applications and moving them to APEX. But ACCESS applications for us seem to be like the Hydra - once I kill one, two more seem to appear in their place ("Oh, you did such a good job fixing our blah-blah database. Did you know about these other THREE...") Keeps me busy though.

  • 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 initial insert issue on details sub-region

    Hello,
    I created a master detail form with report which should do insertion on master and detail region/subregion.
    On insert mode I enter with data master and detail block, when I press "Create" button, insertion happens only on master block (order table) not and on detail block (order_item table).
    On EDIT mode it does insertions/updates on master and detail block without problems.
    Application Express 4.2.1.00.08
    Oracle Database 11g Express Edition Release 11.2.0.2.0
    I appreciate your help.
    Regards

    Something like this should do the work:
    CREATE OR REPLACE TRIGGER order_item_table_tr
       BEFORE INSERT
       ON order_item_table
       FOR EACH ROW
    BEGIN
       IF :NEW.order_id IS NULL
       THEN
          :NEW.order_id := v ('P1_ORDER_ID');
       END IF;
    END order_item_table_tr;
    /Make sure the Automatic Row Processing (DML) of the order table returns key into item > Return Key Into Item > P1_ORDER_ID (or however the primary key of the order table is named)
    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
    -------------------------------------------------------------------

  • How to auto assign a number to some data using PL/SQL

    Hi,
    Assume that i have a few lines of data...
    How do i auto assign number to the data without hardcoding it?
    In this instance, i want p_id to be auto-generate...
    create or replace procedure insert_file
    p_id number,
    p_file_type varchar2,
    p_file_name varchar2
    )as
    geor MDSYS.SDO_GEORASTER;
    begin
    insert into nyp_images values( p_id, p_file_type, sdo_geor.init('NYP_IMAGES_RDT') );
    select image into geor from nyp_images where image_id = p_id for update;
    sdo_geor.importFrom(geor, NULL, p_file_type, 'file', p_file_name);
    update nyp_images set image = geor Where image_id = p_id;
    end insert_file;
    Thanks and regards,
    Esther

    In this case you could slightly change your procedure to
    create or replace procedure insert_file (
      p_file_type     varchar2,
      p_file_name     varchar2,
      p_id        out number
      )as
      geor MDSYS.SDO_GEORASTER;
    begin
      insert into nyp_images values( your_seq.nextval, p_file_type, sdo_geor.init('NYP_IMAGES_RDT') )
         returning image_id into p_id;
      select image into geor from nyp_images where image_id = p_id for update;
      sdo_geor.importFrom(geor, NULL, p_file_type, 'file', p_file_name);
      update nyp_images set image = geor Where image_id = p_id;
    end insert_file;I highly reccommend you to take classes in this SQL and PL/SQL stuff or look for some external ressources that can guide you.

  • Tabular form - how to auto populate a column with the user name

    Hi,
    I have a tabular form with 3 columns - (customer name, notes, user). my users are allowed to enter customer details in the notes section... as soon as the user completes notes section and save the form, I want "USER" field to be auto populate with the user name so that I may track activity by the user...
    Please advice how to accomplish it...
    thanks in advance

    Hi,
    After user saves the forms that means commit to the database, so you can simply write a trigger like:
    CREATE OR REPLACE TRIGGER "AUDIT"
    before insert or update on TABLE1
    for each row
    begin
    :new.user_field := nvl(v('APP_USER'),user);
    end;
    Regards,
    Aljaz
    Edited by: Aljaz on 4.3.2012 22:03

  • Master detail form - drop down list in detail (ADF)

    Hi,
    Been racking our brains for a few days/weeks about this one, and would be grateful for any pointers why this does not work.
    We have developed an in-house application for dealing with risk and chemical assessments.
    The process we have adopted allows users to create an assessment first then they are taken to another form where they are then able to add risk factors/ or chemicals relating to the assessment. The intention is to present the user with the ability to select from a drop down list which contains the chemical names.
    We have been going through the forums and have tried all the examples we can find (all the examples work on our system), but when we try to adapt them to our approach they create an error indicating that they cannot find the values in the entity object.
    Has anyone else come across the same problem or is it that the ADF is not suited to dealing with the master/detail approach and drop down menus.
    The drop down lists are in an ADF table.
    Thanks in advance
    Andrew

    Hi Kuba,
    Thanks for the pointer, I think we tried that one early on. For the time being we have opted for using a selectInputText box, and that appears to be working. Well at least it has got us past the deadline for yesterday, now onto the next deadline.
    Thanks again!
    Andrew

  • In oracle forms how to restrict creating new record

    I have a multi record block, I dont want to create new record. If I use the down key after the last record control is moving to next record. I dont want this to happen. I want to scroll between first and last record.
    Can anyone tell me ?

    Look up the Forms Help for 'system.last_record'.
    I'd code the KEY-DOWN trigger on the block as...
    IF :System.Last_Record = 'TRUE' THEN
    Bell;
    Message('You are on the last row');
    ELSE
    down;
    END IF;
    This avoids any processing or validation work being done on leaving the current record or creating the new record.

  • Forms: how to use COUNT_RECORD to get the number of record retrieved?

    After GO_BLOCK(BlockName)EXECUTE_QUERY, there must a way to obtain the number of records retrieved.
    I like to use this number to display to number of records on the form.
    Clearly, a not so good way is:
    SELECT COUNT(*) INTO :NUM_RECORD FROM Table_Name;
    It queries table one more time.
    Could any one give a clue?
    Thank you.

    Dear Kiran,
    Fom tables EINE (inforec no, plant) and EINA (inforec no, material, vendor), you can get the desired information.
    Regards,
    Prasanth

  • How to config to Time Recording ID Number are the same Personnel Number?

    Dear all,
    My schedule is Time Recording ID Number are the same Personnel Number. So Please hepl me config to Time Recording ID Number are the same Personnel Number. 
    Thank for your help.
    Huyen Nguyen

    Hi,
    The time recording ID is the link between your personnel number in SAP and the time data captured by a swipe card.
    When card is swiped on the terminal..the machine notes the timings, clock types, door ID, Card ID, etc.
    The system identifies the personnel in SAP on the basis of the ID number which will also be there on the swipe card.
    There isn't any config to maintain the ID in IT0050. Just maintain this value in IT0050 as any number, personnel number say, and use the same value while configuring data transfer frm recording machine to SAP via RFC.
    Hope this helps.
    Regards,
    Shreyasi.

Maybe you are looking for

  • Copy contents of a txt file into a transport request

    I am implementing the steps of the 990534 note. The note says "Create a new transport request (transaction SE09) in the source client of your Solution Manager system. Unpack file SOLMAN40_MOPZ_TTYP_SLMO_000.zip, which is attached to this note. Copy t

  • 2 ipods on 1 computer, but only 1 works.

    My boyfriend and I both got ipod nanos, he got his first so we installed everything onto my computer and his is working just fine, it updates when we download new music and has no problems. Then I bought mine and assumed it would work just as well, b

  • TDS Certificate, Challan Payment Issue and BSR Code Issue

    Hi All, I have configured Extended withholding tax as follows and encountered some issues 1. Specify Document Type (Accounts Payable): Here I have given Document type as SA and I am able to Pay the remittance challan through Post Vendor challan trans

  • How to identify offseting account

    Dear friends i am creating zreport in which i have some query related to offsetting account. please find some details. while viewing GL account in FBL3N , we found different document numbers aginst these document number there is an offsetting account

  • Upload / email form

    hello everyone. i made an upload files page with a browse button and text fields for the client to put their information in. how can i make the "submit" button upload the file to my server AND send me the email at the same time?? the uploading part w