FRM-41106 You cannot create records without a parent record.

Hello!
Forms 6i.
I have a Parent-Detail-Relationship. At the Detail-Block a "When-create-record" sets some default values on the Detail-Block.
I got error "FRM-41106 You cannot create records without a parent record" when the Parent-Block executes a execute_query.
I debuged the problem an found out, that the error appears in the standard-programunit "Clear_All_Master_Details".
The error appears, when the code is deleting the detail-block "code: Clear_Block(NO_VALIDATE)".
This is strange: The error appears only when I uses the "When-create-record"-trigger on the detail-block.
If a comment out the trigger, no error appears.
Why Is a "When-create-record"-trigger initiated when deleting the detail-block?
Default-Code of "Clear_All_Master_Details":
-- Clear all the detail blocks for this master without
-- any further asking to commit.
currel := Get_Block_Property(trigblk, FIRST_MASTER_RELATION);
WHILE currel IS NOT NULL LOOP
curdtl := Get_Relation_Property(currel, DETAIL_NAME);
IF Get_Block_Property(curdtl, STATUS) <> 'NEW' THEN
Go_Block(curdtl);
Check_Package_Failure;
Error appear here----> Clear_Block(NO_VALIDATE);
IF :System.Block_Status <> 'NEW' THEN
RAISE Form_Trigger_Failure;
END IF;
END IF;
currel := Get_Relation_Property(currel, NEXT_MASTER_RELATION);
END LOOP;
Thx in advance,
Wolfgang

Wolfgang,
To be honest, I've always done this kind of thing in the Pre-Inse rt or Pre-Upda te triggers. Why is it so important for the user to see the value of these field BEFORE the IN SERT or UPDAT E? Once the record is commited, they will see these values in your form. In my experience - users are typically satisfied with this approach. If your users are not OK with this approach, perhaps you could us a When-Validate-Record trigger instead of the When-Create-Record trigger.
I think the When-Create-Record option would still work, but your code will need a little tweak. Give the following a try:
   IF ( NVL(:termin.best_nr,'MSTR') = NVL(:pos.best_nr,'DTL')
        AND NVL(:termin.best_jj,'MSTR') = NVL(:pos.best_jj,'DTL')
        AND NVL(:termin.best_pos,'MSTR') = NVL(:pos.best_pos,'DTL') ) THEN
       <<...set_values..>>
   END IF;Remember, NULL values do not always get evaluated correctly so it is always best to use the NVL function to ensure fields are evaluated correctly.
BTW, you indicated that you ran DEBUG on your trigger, when your IF statement was evaluated did the "set_Values" section of your code run? If it didn't - do you have other code in your WCR trigger that is setting values outside of your IF statement?
Craig...

Similar Messages

  • FRM-41051:  You cannot create records here

    Hello all,
    I have two blocks 'FIND_EMP' and EMP_HDR.
    In 'FIND_EMP' i have fields below like
    Dept name -------
    Location ------
    EMP no -------------
    find(button) new_emp(button)
    I you need to create a new employee we need to select dept name and location from lov and click new emp button.Then it will navigate to EMP_HDR block
    In EMP_HDR block i have fields below like
    Dept name -------(wiil be defaulted from 'FIND_EMP' block)
    Location ------(wiil be defaulted from 'FIND_EMP' block)
    EMP NAME ---------(USER INPUT)
    DOB-----------(USER INPUT)
    Emp no----------(populates a sequence no when user clicks submit)
    Submit(button)
    for the coresponding dept name and location user enters new employee name and dob and clicks submit button then empno field will be populated and it will close the EMP_HDR block window and will return to 'FIND_EMP' block.
    Again if I try to create new employee by pressing new_emp(button) it is giving an error message below.Even in the block level propery pallete also insert allowed and update allowed is set to YES
    "FRM-41051: You cannot create records here." (ie,Do not attempt to create and insert new records into this block until you have set the Insert Allowed block property to True.)
    To avoid the above error i enabled the block property insert allowed to true under new_emp(button) logic
    SET_BLOCK_PROPERTY('EMP_HDR',INSERT_ALLOWED,PROPERTY_TRUE);
    now it is not giving any error and everything is working fine.
    But my doubt here is before block property insert allowed to true is not enabled, then
    for the first time I try to create new employee it is creating a record and for the same session
    creating again new employee it is giving error message(FRM-41051). I could not understand.Any body please clarify on this.
    Regards,
    Kiran

    i think you had some other code which was blocking the insert allowed in your EMP_HDR block...
    kindly check other places where it was blocking it...
    might be possible on submit button you have such code to block insert.. because you entered first record than submit,, after that block property changed to insert_allowed false...
    -- Aamir

  • FRM - 41105 You Cannot query records without a saved parent record

    I have 3 data blocks. The contro data block have document type and document number if we come to new record(I have written execute query for both header and detail part) the header block will show the detail of the documnet header(Header Details) and detail block will show the detail part.
    But my problem is when new record instance only the header block is querying and detail block is not querying and giving an error message(*FRM - 41105 You Cannot query records without a saved parent record*)!!
    Plz help me!!
    Thanks in advance,

    yea header tables PK is refered in the details table.
    and i have master record created already and have the detail record for those master records in the table.
    i want to query the detail record related to that master when we select a document number and document code in the control block.
    Its querying the master detail relevent to that header and giving this error messge while quering the detail record..

  • You cannot create an Apple ID using a MobileMe account. If this is your email address, it is also your Apple ID

    I am dumping my Android and getting an IPhone to go along with my IPad, primarily because of the ICloud and the ease of synching all my mail, contacts etc. My original Apple ID was my gmail address. I now have the @me.com address when I put IOS 5 on my iPad. I want to dump gmail and just have one email address...the @me.com address. When I set up iCloud, I used the @me.com address. When I try to change my Apple ID to the @me.com address from the gmail address, I get this message "You cannot create an Apple ID using a MobileMe account. If this is your email address, it is also your Apple ID". Any ideas?

    I also have the same problem. Is there a solution?

  • You cannot create ARE3 for duty paid Deemed exports excise invoice!

    You cannot create ARE3 for duty paid Deemed exports excise invoice!
    Message no. 4F326

    Hi murali,
    How can you create ARE document for duty paid excise invoice
    ARE docs are for excise exption purpose only
    regards
    bvdv

  • You cannot create a customer with grouping ZLES

    hi friends,
    I am encountered with the below message during BP creation "You cannot create a customer with grouping ZLES"
    ZLES being the account group..
    I ve come across the following..
    I made config for BP to Customer ( auto creation)
    and also BP to Vendor ( auto creation)
    at a time only one of the thing is working either BP to customer or BP to vendor..
    when i check the config  under Number Range>Define Groupings and Assign Number ranges> in this there is a radio button Int.Std.Grping if this is marked for the grouping of Mast tenant with Cust acc  then there is no error for this but error persists while creating BP to Vendor.. and if the radio button is ticked for Landlord with vendor Account then the issue comes for BP to Customer i.e the error "You cannot create a customer with grouping ZLES"
    how can i tick both of them together ( if there is possiblity)
    kindly help

    sorry for late reply.
    if ur issue isn;t solved?----
    in  Define Groupings and Assign Number Ranges dont select the raido button for your grouping . and next thing is while creating business partner. follow these steps...
    1 bp
    2 click on person, group or org as desired
    3 select the role and click create. AND
    4 at right hand side corner there is Grouping select the Grouping ( i was missing this step due to which i used to get the error)
    hope this will solve ... also check the account groups of both BP and Customer or else there will be synchronisation error..
    regards

  • Cannot Create Delivery without RLT

    Dear All
    I do not want to create Delivery unless inventory is available. So I have controlled it through Checking rule B, doing it without RLT. But Cheking rule A in Sales Order is with RLT so that I can confirm Customers Order.
    I have a strange Scenario.
    My Stock is 60. Sales oreder created for Today is 5 qty, so Confirmed Schedule line.
    Sales order with Schedule line date 31.12.2008 is 200 qty. So this is confirmed after end Lead time.
    But When I create Delivery it does not let me beacsue 60 stock available is now  booked for Sales order 31.12.2008.
    I know the reason that in Delivery creation RLT is not taken into consideration.
    But How this situation should be handled. If I do delievry ATP check with RLT then there are chances that Delivery may be created without stock.
    Experts opinions are invited.
    Regards,
    Neeraj Srivastava

    Hi christine,
      You can create delivery with quantity 0. But you need to customize at the delivery item category level. Once you complete this customizing system will allow you to create delivery with qty 0.
      If you would like to have the do the PGI, when the stock is available, then you need to configure Availabilty check at shipping level. Once you run the availabiltiy check in VL02N transaction, based on the ATP calculation, system will confirm the qty.
    Regards,
    Ravikiran Pochiraju

  • Creating material without material master record

    Hai,
      Can u pls help to solve this scenario.
      client is having MTO type Business Process.
      They have to create a material which doesnt have material master record in quotation.(So we Can have text material).
    But for that material we neeed to do costing , so i have activated EK02 in QT doct type.
    So costiong is possible for normal material.
    But for text material error comes as like.
    *_Specify at least 1 unit__Message no. BM018*_
    _Diagnosis_
    No unit was included. Conversion or determination of conversion factors is therefore not possible.

    Here there are 2 Options: can be follow,-
    - 1:
    Client has to create one dummy material & do the costing for this material, Once Client receives the Purchase Order from the Customer, then create Order with ref to the same quotation & Change the Dummy Material to the New Material-FG product.
    would be the better option,
    02:
    we too have same scenario, But we have told the Client, before Preparing Quotation, create FG material & do the Costing. In our case, Client is preparing Costing sheet based on Order i.e Product Cost by Order.
    Becoz without FG , user cant have BoM for the same.
    It is regular field requirement.

  • FRM _40200: You cannot update this field

    How can I get this message to display?? I have a text item which has insert allowed, and update allowed set to false, and if the user tries to update the text item, then I want that message to display, like I have seen on other forms... but it doesn't...
    cheers

    Hi Paul,
    Try getting the warning message , i don't remember FRM-40.... <cannot update field> and using this message warning in ON-ERROR trigger in order to display the message you want...
    Or ,
    getting the status of the text item (new , updated , changed) and on a trigger such as post-text-item , key-others .... call the message procedure to display the message you want....
    Simon

  • NOKIA, YOU CANNOT LEAVE US WITHOUT VOIP V2.0 FOR T...

    Dear Nokia people
    You showed us, with the Firmware 3.x for the E61, that the new VOIP 2.0 is a very useful extension !
    Why are you hesitating to make it available for the E60 (E70) ? It cannot be a technical issue, the platforms are very similar !
    Dear people at Nokia, please give us an explanation, or a timeframe for the VOIP 2.0 implementation on the E60 (E70) !!!
    We have trusted you for a long time, let us trust you in the future too, dont't disappoint us after so many happy moments with your wonderful phones !
    Best regards
    CC

    I agree. Nokia , please listen. I bought my E70 for full VOIP functionality. This is how it was sold to me, and I fervently hope you change properly update the firmware.

  • Error: you cannot create an internal table as work area

    Hi, My code is as follows and when i perform a check it gives the above mentioned error in the select statement.
    TYPES: BEGIN OF t_vbrk,
            vbeln            TYPE vbrk-vbeln,
            vtweg            TYPE vbrk-vtweg,
          END OF t_vbrk.
    DATA vbrktab TYPE TABLE OF t_vbrk.
    SELECT      vbeln
                    vtweg
             FROM   vbrk
             INTO  vbrktab
             FOR ALL ENTRIES IN xxcvb
             WHERE  vbeln       = xxcvb-vbeln.
          INSERT TABLE vbrktab.
        ENDSELECT.
    where xxcvb is another internal table with some key values.

    Hi
    I don't know how you've defined XXCVB, but u should write:
    TYPES: BEGIN OF T_VBRK,
             VBELN TYPE VBRK-VBELN,
             VTWEG TYPE VBRK-VTWEG,
           END OF T_VBRK.
    DATA: VBRKTAB    TYPE TABLE OF T_VBRK,
          WA_VBRKTAB TYPE T_VBRK.
    SELECT VBELN VTWEG FROM VBRK INTO TABLE VBRKTAB
      FOR ALL ENTRIES IN XXCVB
         WHERE VBELN = XXCVB-VBELN.
    LOOP AT VBRKTAB INTO WA_VBRKTAB.
    ENDLOOP.
    Max

  • "You cannot create an Apple ID because you do not meet the minimum age requirement."

    I made this account for my mom. After she puts in her info it tells her she is not old enough. Birth date is 0/09/1964. She cannot acces the apple store from her ipod touch because of this.

    Apple ID FAQ
    http://support.apple.com/kb/HE37
    Apple ID Support
    My Support Profile
    http://www.apple.com/support/appleid/contact/

  • Deletion of child records linked to parent records to be deleted etc..

    'Combined with WHEN OTHERS, SQLCODE provides a way for you to handle different, specific exceptions without having to use EXCEPTION_INIT pragma. In the next example, I trap two parent child exceptions, -2292 and -2291, and, then take an action appropriate to each situation:
    PROCEDURE delete_company (company_id_in IN NUMBER)
    IS
    BEGIN
    DELETE FROM company where company_id = company_id_in;
    EXCEPTION
    WHEN OTHERS THEN
    DECLARE
    error_code NUMBER := SQLCODE;
    error_msg VARCHAR2(512) := SQLERM;
    BEGIN
    IF error_code = -2292 THEN
    /*Child records found. Delete these too */
    DELETE FROM employee WHERE company_id = company_id_in;
    /* Now delete parent again */
    DELETE FROM company WHERE company_id = company_id_in;
    ELSIF error_code = -2291 THEN
    /* Parent key not found */
    DBMS_OUTPUT_PUT_LINE('Invalid company id' || TO_CHAR(company_id_in));
    ELSE
    /* This is like a WHEN OTHERS inside a WHEN OTHERS */
    DBMS_OUTPUT_PUT_LINE('Error deleting company, error: ' || error_msg
    END IF;
    END;
    END delete_company;
    Sourced from Oracle PL/SQL Programming (3rd edition) P.143
    1. Are error_code and error_msg assigned automatically or do I have to include assignments? If yes, how?
    2. Where do I get a list of commonly caught Oracle error codes and similar code snippets used for business logic?
    3. How would you deal with the situation where you detect a parent while you are deleting a child record? Just warn the user and log it hoping the DBA will review the logs?
    4. I work within a project where I could not query any parent-child relationships, using, amongst other queries the following query, and, this means that the programming team might not be creating these relationships within the database (Oracle 11g).
    What are the technical risks?
    Could I be omitting something, because it seems quite incredible to me that parent-child relationships are not in place?
    SELECT a.table_name,
    a.column_name,
    a.constraint_name,
    c.owner
    FROM ALL_CONS_COLUMNS A, ALL_CONSTRAINTS C
    where A.CONSTRAINT_NAME = C.CONSTRAINT_NAME
    and a.table_name=:TableName
    and C.CONSTRAINT_TYPE = 'R'
    Sourced from http://stackoverflow.com/questions/1729996/list-of-foreign-keys-and-the-tables-they-reference

    This is bad code, very very bad code. Throw it away and start with a clear idea of what you want to do.
    Why is this code very very bad? Because it uses WHEN OTHERS not followed by a RAISE.
    Why is this code bad code? Because it uses one WHEN clause instead of several.
    Here is an example for handling multiple exceptions:
    http://docs.oracle.com/cd/E11882_01/appdev.112/e25519/errors.htm#BABFBHGA
    If your error code does not have a predefined name, define the name yourself:
    http://docs.oracle.com/cd/E11882_01/appdev.112/e25519/errors.htm#BABIIEFC
    If you keep the WHEN OTHERS at the end, be sure to add RAISE so the exception still exists. If you don't, Oracle will not do the automatic rollback it should be doing.
    To answer your question about parent-child relationships, it is very important to have them. They stop you deleting a parent that has children, but they do not stop you from deleting children.

  • Find child record of a parent record

    Hi,
    I need to find the child recond of a parent party and if that child also have some
    child then I need to find again and this process will go untill no child record
    found(child is null)
    I am trying to do it by the help of hierarchical query.
    can anyone please help and tell me how can I do that and how can I handle if a parent have multiple childs.
    Mohan

    It is always helpful to provide the following:
    1. Oracle version (SELECT * FROM V$VERSION)
    2. Sample data in the form of CREATE / INSERT statements.
    3. Expected output
    4. Explanation of expected output (A.K.A. "business logic")
    5. Use \ tags for #2 and #3. See FAQ (Link on top right side) for details.
    Also see the third post in this thread:
    {thread:id=2174552}
    This would probably be better suited in the {forum:id=75} forum.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Error while querying - You cannot update this record

    Hi all,
    I have a builded a form and was successful when i enter the data. But when i query the form it is showing me the error FRM-14050 YOU CANNOT UPDATE THIS RECORD.
    I have pre-insert, pre-update and pre-query triggers at block level.
    In PRE_INSERT iam setting the property to insert allowed and true.
    same way for pre-update and pre-query.
    Can any one guide me.
    Thanks
    Sunil

    Hi
    check your fields name name and match with database fields.
    vikas

Maybe you are looking for