Filtering the detail block before saving records

I have my form
Head_Blk
Det_Blk

I get in my Det_Blk from Table1, via a query defined in WHEN TIMER EXPIRE at the form level
GO_BLOCK ('det_blk');
CLEAR_BLOCK;
FOR idx IN C_QUOT LOOP
IF: SYSTEM. RECORD_STATUS! = 'NEW' THEN
CREATE_RECORD;
END IF;
: D_PROD_CODE: = IDX.prod_CODE;
: D_PROD_NAME: = IDX. PROD_name;
: D_QTY: = IDX. QUOTD_qty;
: D_RATE: = idx.quotd_rate;
num_total_rows: = C_QUOT % ROWCOUNT;
END LOOP;
PREMIER_ENREGISTREMENT;

The det_blk is filled with records, now user will enter into quantity in some records, NOT necessary all records.

How can I finally register records of block detail, just whose quantity is greater than 0.

Please advice me... TYVM

Try this in the VALIDATION KEY:

GO_BLOCK('det_blk');
FIRST_RECORD;
WHILE (:system.record_status != 'NEW' ) LOOP
   IF :det_blk.D_QTY = 0 THEN
     CLEAR_RECORD;
   END IF;
   NEXT_RECORD;
END LOOP;
COMMIT_FORM;

Tags: Oracle Development

Similar Questions

  • The default values on the retail block for dummy record gets inserted in detail blk

    Hi all

    I have a master block
    a block of detail and a detail for detail block block

    For every master I have or have no certain records in the block of retail

    for each master, I have a few detail records

    for each detail record I may or may not have the corresponding detail records

    Let's take an example
    I navigate a primary record to the detail record.
    in the 3rd block of retail, there is no record for the record in detail, but I have some default values.

    Now I navigate to the 3rd block of detail and I do not insert records and then exit the screen

    Here oracle asks me to save all the changes I made (I did no changes)
    and by clicking on Yes, there is a dummy record is created for a 3rd detail record

    Please help me

    Thank you

    This is the default values are to mark the block as being changed. That's why you get the message "do you want to save the changes.

    I suggest that you fill out elements of the base with the default values table and fill out the matching elements from the base on a prior insertion trigger table.

  • Update of the detail block

    Hello

    I have 3 blocks on my form for example something like order number, line number and the quantity ordered. Order number is master block and line number is it's detail & line number is a master of order of quantity as is the detail. Line number and the quantity ordered cannot update or insert on.

    I set up so that when I ask order number, it gives different numbers of line and the quantity associated with the number of the line.

    for example

    Order number 2020222787972

    Number of line 1
    2
    3

    Quantity ordered 45

    where 45 is the quantity ordered for the line number 1.

    I want to be able to double-click on a different line number and when I do it has the quantity ordered of update to take account of the quantity ordered for the line number with this order number, but I don't know how to write the trigger to do this.

    Could someone offer any help?

    Thank you much much in advance,

    Published by: user6549864 on October 17, 2008 01:01

    Assume that the lines are in block SUMMARY summary field id and block ONLINE

    You can do the following:

    :SUMMARY.QUANTITYITEM:=:LINE.QUANTITYITEM;
    

    places in a WHEN-MOUSE-DOUBLE-CLICK-trigger on the line to block works when doubleclicking, placed in a TIMES-NEWS-RECORD-INSTANCE-trigger is change when navuigating to the specific line. In the case of showing during navigation, it would be still more senseful to place the point summary point in block PAY directly and set "no property of elements poster"1 and set article summarized as mirror-element for the original amount column

    hope this helps

  • Validation of the detail in a form records master detail.

    Hi all

    IAM trying to validate the detail records in a form master detail. I have a check box in the detail Section. I want to add validation that all the detail records are checked or all are unchecked. To do this, I added valdation method on the entity to master, but it only runs when any attribute of the master record is changed, but not when it comes to his detail record is updated or inserted. Please tell me where I can write this validation logic or how can I trigger to perform the validation method when a child record is updated.

    Thank you, Pradeep

    Please ask such questions on the JDeveloper forum in the future because it is not related to the JHeadstart.

    To get the desired behavior, you must check the Association membership on the association of the entity between the master and detail EO.

    Steven Davelaar,
    Jheadstart team.

  • How to install the CD player to ask the download folder before saving?

    When I download a PDF via the web browser, one behaves like a normal download and the settings of the web browser is followed. But if the player is open, the download is always saved in documents/downloads folder

    How to save a PDF file to a default location (Acrobat Reader)

  • How to query the master block based on one of the values of the detail block

    Hello
    In the form of version 6i, I have a field in data block which is not defined as a database element. I use this field to store a block of retail value. If I want to ask the form using this field (which represents one of the values of retail block), how should I do this? Pointers?

    TIA,

    Yes, as Ammad10786 says, the ID's I mentioned are just placeholders for your real values. And done MASTERBLOCKID refers to columns in the masterblock which is the primary key or the join condition to the retail block.

  • validate the detail block

    Hello

    I have the block master / detail on form 10g. multi-record block of retail is.

    When the master record is added or updated to ensure there is at least one record.

    at the form level tried post-forms-validation validation

    If: emp_detail.join_date is null then
    message ("join date cannot be empty '");
    raise form_trigger_failure;
    end if;

    This creates problems when deleting the record in a case.

    If all the records are reterived (f11 + ctrl f11) and then go to the record to delete, record is deleted.
    But if the particular record (for example emp_id 102) is extracted, then registration is not deleted as post-forms-validation validation is met.

    What should be done to ensure that there is at least one record in the block of detail while adding and updating and deletion of not.

    Thank you

    If they are in the template, I guess they are defined at the level of the form. You can INSERT before extra and PRE-UPDATE-triggers at the block level (and this is where they belong in your case). With adjustment of the hierarchy of execution before or after your model-triggers will always run.

  • Set the element property in the detail block

    Hello

    I wish to address an item property in my block of detail that consists of several documents as a tabular presentation. For example, when I use APIs like the code below. The API defined the entire column for this particular element rather than the game each element in each record. Could you please take a look below coding and advisor how I can configure each element in each record?


    -----------------------------------------------------------------------
    BEGIN


    GO_BLOCK ('USER_RESP');

    last_record;
    premier_enregistrement;
    LOOP

    If: USER_RESP. End_date is null then
    -app_item_property.set_property ('USER_RESP.) END_DATE ', ALTERABLE_PLUS, PROPERTY_OFF);
    set_item_property('USER_RESP.) END_DATE ', INSERT_ALLOWED, PROPERTY_OFF);
    set_item_property('USER_RESP.) END_DATE ', UPDATE_ALLOWED, PROPERTY_OFF);
    end if;

    When the output: system.last_record = "TRUE";
    next_record;
    END LOOP;
    premier_enregistrement;




    END;

    --------------------------------------------------------------------------------

    Published by: user11270809 on January 12, 2010 18:15

    Hello
    better do you in pre-record trigger

    If: USER_RESP. End_date is null then
    SET_ITEM_INSTANCE_PROPERTY('USER_RESP.) END_DATE ', CURRENT_RECORD, UPDATE_ALLOWED, PROPERTY_FALSE);

    on the other
    SET_ITEM_INSTANCE_PROPERTY('USER_RESP.) End_date ', CURRENT_RECORD, UPDATE_ALLOWED, PROPERTY_true);
    end if;

    Published by: amitphynyl on January 12, 2010 23:19

  • Report of the Summit with the details below for a record

    Hello

    I'm looking for an answer to my problem:

    We have a report that contains many ~ 60.

    And is not very user-friendly because it is so wide table.

    It is possible to see some less important columns as information additional report below.

    for a single record in the report. For example, the user selects the radio button of the first column and details are updated for this record.

    (if it is possible to group information in tabs)

    Thank you very much for your answers.

    Hello

    Here is an example

    https://Apex.Oracle.com/pls/Apex/Apex/f?p=39006:41

    Create a hidden item which is not protected. In my case the name of the element is P41_DEPTNO

    First report query

    select
    APEX_ITEM.RADIOGROUP(1,DEPTNO,:P41_DEPTNO) AS rg,
    EMPNO,
    ENAME,
    JOB,
    MGR,
    HIREDATE,
    SAL,
    COMM,
    DEPTNO
    FROM EMP
    

    Second report query

    select LOC,
      DNAME,
      DEPTNO
    from DEPT
    WHERE DEPTNO = :P41_DEPTNO
    

    In the second region report defined the elements of the Page to submit your name for the hidden item.

    Create dynamic action

    -event: change

    -Selection Type: jQuery Selector

    -jQuery selector: input [name = f01]

    -Action: Value set

    -Set type: Expression JavaScript

    -Expression JavaScript: this.triggeringElement.value;

    -Selection Type: Item (s)

    -Article (s):

    Then add an another true dynamic action event

    -Action: update

    -Selection Type: region

    -Region:

  • Data not to see the detail block on running the query

    I have a dev - 6i form. It contains two revenge joined database. The form was working properly but now all of a sudden, as I F8 run query it gives two error messages and do not run the block of detail data.

    FRM-40819: System Variable is not editable.
    FRM-40735: trigger YOU POPULATE DETAILS raised unhandled exception ORA-06502.
    What is the reason how to get rid of him?

    Hello

    Unless changes occurred, you will not get error, maybe it occurred without your knowledge.

    Cases - open your source fmb file, rename and delete the link and create the link - compiles now.

    Run the form, and then paste the result here.

    -------------

    Gul says:
    I have a dev - 6i form. It contains two revenge joined database. The form was working properly but now all of a sudden, as I F8 run query it gives two error messages and do not run the block of detail data.

    FRM-40819: System Variable is not editable.
    FRM-40735: trigger YOU POPULATE DETAILS raised unhandled exception ORA-06502.
    What is the reason how to get rid of him?

  • Prevents the user to insert only the main block

    Hello

    Form [32 bit] Version 6.0.8.11.3 (Production) and win 8.

    1. I have a block of master / detail, but normally, the user can insert records in the master, or in the retail block,.

    I stopped to insert only in detail a mating by changing the property "to prevent operations without a master" of the relationship.

    but he can always insert only in the main block, how to prevent this?

    2. what was spent on the forum, there is no one answering questions, there are simple questions that I posted about two days ago

    and they're stuck since when, where are the people?

    See this thread:

    Block master / detail: how to save changes if the retail block has a record

    ('Zlatko Sirotic' is my 'old' user id - before the 7 Jive OTN forum upgrade)

    Concerning

  • How to validate that a single check box is checked in detail block

    Hi all

    I am using oracle 10 G on windows forms.

    I need help on how to validate that a single checkbox is checked in the retail block. I have multiple records in the block of detail and I have checkboxes for each record in the detail block.

    I have a button to select values in the detail records where the check box is checked. But I want to make sure that only one record is not more than one check.

    How to validate this on a shutter release button?

    Thank you

    When I did this sort of thing, I create a variable of TYPE number form level and then add or subtract the variable I to check and uncheck the boxes. If the value of the variable is 1, then you know that only check box is selected. If the value is greater than 1, then you know that the user has selected more than one checkbox. You could also add the code to your trigger when-box-changed to test the variable and tell the user to uncheck selected record before selecing a new record.

    Regarding the variable level of form, you can use a GLOBAL package specification, PARAMETER or program unit. I prefer to use the specification of CENTRAL unit package, because this method has a smaller memory footprint. For example, in the node of the unity of the object browser program create the following:

    /* Form variables package spec */
    PACKAGE Form_Vars IS
      CheckBox_Cnt     NUMBER := 0;
    END;
    

    Now in your trigger when-box-change...

    BEGIN
       IF ( Form_Vars.CheckBox_Cnt = 0 ) THEN
          Form_Vars.CheckBox_Cnt  := Form_Vars.CheckBox_Cnt  + 1;
       ELSE
          /* it's assumed the value is greater than 0 */
          Message('Please uncheck selec ted record before choosing a new record.');
          RAISE Form_Trigger_Failure;
       END IF;
    END;
    

    Hope this helps,
    Craig B-)

    If someone useful or appropriate, please mark accordingly.

    Published by: Silvere on February 3, 2011 10:15

  • saving record

    Hi all
    I use form6i & oracle 8i.
    I'm a master - detail form. both are blocks of data.
    I inserted values for the main block of block & details
    My problem is...
    * "the user does not" * to move to the record next to the main block before you save the current record "

    Please help me

    Thank you

    Hello
    You can check the thread
    Navigation control

  • Coming out of the block how to invite the message like "do you want to save changes?" so any changes made in the current block

    Hello

    I'm working on the Oracle forms 6i. I have a custom query search window (do not use the Oracle QUERY_FIND seeded window feature). Build manually (BLOCK_1 and WINDOW_1). When I click on the search button, then I Block table that has windows (BLOCK_2 and WINDOW_2) and in this form, I have a button called details. When I click on the Details button, it opens the details Block (BLOCK_3 and WINDOW_3).

    There is no functionality seeded t define the relationship of master details. (everything is customized)

    Now, if the user has made a few changes on the block of retail and click the X (close) on this window without COMMIT the record, then how can I display a message to the user as a block level saying that "Do You want to save changes?" and after selecting one of the action i.e. Yes, no or cancel how to perform the action according to the user's action.

    This form I have three different blocks and WINDOWS for individual block so when i have all three open window and click on F4, then it closes all windows of three then how can I close the window when the user uses them short key F4 to close the window.

    Thank you very much in advance.

    Melanie,

    Thanks for the update. I tried KEY-EXIT, WHEN now-BLOCK-INSTANCE, KEY of VALIDATION, but unfortunately these triggers are not fired. I found the work around that.

    I made after the code in the APP_CUSTOM package in the close_window procedure.

    IF: SYSTEM. BLOCK_STATUS = 'CHANGE '.

    THEN

    FND_MESSAGE. SET_STRING (' do you want to save the changes you made?) ');

    l_button:-fne_message.question(button1...icon);

    and then based on the user action that performs the action.

    END IF;

    It works for me. Problem solved.

    Thank you very much for your time and your suggestions.

  • How to master day & detail block approal flag?

    Hello experts,

    I have the main form and details homologation form.

    the user will select a docment is and records master & details will be questioned.

    now it will just click the button approve and master & details of approval flag will be updated.

    Give me a logic how to implement...

    Note: the user will not manually penetrate anything.

    Please help me.

    Thank you

    Yoann

    What exactly is the problem?

    Update the indicator in your master block, go in the detail-block and loop through all records, to update indicators accordingly.

Maybe you are looking for