IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Forms Oracle Discussion :

[Forms6i] FRM-40102 dans bloc multiligne


Sujet :

Forms Oracle

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre confirmé
    Inscrit en
    Mars 2005
    Messages
    119
    Détails du profil
    Informations forums :
    Inscription : Mars 2005
    Messages : 119
    Par défaut [Forms6i] FRM-40102 dans bloc multiligne
    Bonjour,

    Dans un bloc multiligne j'obtiens une erreur FRM-40102 lorsque j'essaie de créer un nouvel enregistrement (via le bouton 'Insérer enregistrement' ou en faisant 'fleche bas' sur la derniere ligne active).
    J'ai tracé l'erreur a l'aide du debugger et la situation est la suivante :
    - Je clique sur le bouton 'Insérer enregistrement' ce qui me conduit vers le trigger When-new-record-instance
    - Dans ce trigger j'appelle une procedure afin d'initialiser mon bloc principal ainsi que d'autres blocs (les blocs détails dépendant de mon bloc principal)
    - FRM-40102 apparait lors de la premiere tentative d'initialisation d'un bloc détail alors que je me place bien sur le bloc avant de lancer create_record :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    GO_BLOCK('BLK_T319');
    Create_Record;
    Je suis un peu perdu sachant que tout ce que j'ai pu trouver sur le net ou sur metalink etait lié au fait que l'on etait pas positionné sur le bloc via GO_BLOCK....
    Qqun a une idée ?
    Merci !

  2. #2
    Expert confirmé
    Avatar de SheikYerbouti
    Profil pro
    Inscrit en
    Mai 2003
    Messages
    6 760
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mai 2003
    Messages : 6 760
    Par défaut
    Lorsque vous êtes en création d'enregistrement, vous ne pouvez pas quitter cet enregistrement tant qu'il n'est pas correctement renseigné ou alors supprimé.

  3. #3
    Membre confirmé
    Inscrit en
    Mars 2005
    Messages
    119
    Détails du profil
    Informations forums :
    Inscription : Mars 2005
    Messages : 119
    Par défaut
    Justement, dans ma procedure je renseigne dans un premier temps les champs de mon bloc principal puis je passe au second via GO_BLOCK() et Create_record...

  4. #4
    Membre confirmé
    Inscrit en
    Mars 2005
    Messages
    119
    Détails du profil
    Informations forums :
    Inscription : Mars 2005
    Messages : 119
    Par défaut
    Bon je m'en suis sorti en remplacant

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    GO_BLOCK('BLK_T319');
    Create_Record;
    par

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    GO_BLOCK('BLK_T319_FRM_REVISION');
     
    IF :SYSTEM.RECORD_STATUS = 'NEW' THEN	  
    SET_RECORD_PROPERTY(TO_NUMBER(NAME_IN('SYSTEM.CURSOR_RECORD')),'BLK_T319_FRM_REVISION', STATUS, INSERT_STATUS); 
    END IF;
     
    LAST_RECORD;
    Create_record;
    Je me suis basé sur la note Note:251310.1 de Metalink :

    Understanding and Resolving FRM-40102 : Record Must be Entered or Deleted First

    PURPOSE
    -------

    To explain why the error FRM-40102 occurs, and provide tips / work-arounds
    as to how to avoid it.


    SCOPE & APPLICATION
    -------------------

    Target Audience: Support Engineers, Consultants, Forms Developers
    Some familiarity with Oracle Forms development is expected

    Understanding and Resolving FRM-40102 : Record Must be Entered or Deleted First
    ------------------------------------------------------------------------------------------------------------------------

    Here is how the Oracle Forms documentation describes the reasons for why
    FRM-40102 occurs:

    Cause: You pressed [Next Record] or [Down] in a context where it is
    meaningless. Either:

    1. The last record in a block is the current record.
    2. The block is empty.
    3. You are in a new record in the middle of the block created by pressing
    [Insert Record].

    Action: No action is necessary.
    Level: 5
    Type: Error

    Some typical scenarios with work-arounds provided:
    --------------------------------------------------

    1. An attempt is made to navigate to the next record in a block. However the
    :SYSTEM.RECORD_STATUS of the current record is "NEW". FRM-40102 occurs because
    Forms will not allow navigation to the next record status is NEW. This record
    may contain values that have not been saved. These values may not have been
    typed in by the user, rather than could have derived the 'Default Value' item
    property or were programmatically assigned via a trigger e.g WHEN-CREATE-RECORD
    Forms marks the record status as NEW when the record is created, regardless
    if the items in the record are populated using the Default / Initial Value
    property, the Copy item property or programmatic assignment.

    Solution Description:

    Include a button item in the multi-record block which will display in front of
    each record. e.g The button may have the label 'OK'. It will act as an "OK"
    button, meaning the user wants to accept the default values that the
    record was created with. Set the "Mouse Navigate" property of this button item
    to FALSE.

    In a WHEN-BUTTON-PRESSED trigger for this button, code:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    SET_RECORD_PROPERTY(TO_NUMBER(NAME_IN('SYSTEM.CURSOR_RECORD')),'blockname', 
    STATUS, INSERT_STATUS);
    The code will set the record status from NEW to INSERT allowing the user to
    cursor down to the next record without the FRM-40102 error occurring.

    Notes:
    - A record whose current status is NEW can transition to QUERY or INSERT status,
    but cannot transition to CHANGED status.
    - FRM-40102 will occur before the WHEN-VALIDATE-RECORD and POST-RECORD triggers
    fire, so calling SET_RECORD_PROPERTY in any of these triggers will still not
    allow the user to cursor to the next record. The error will occur before the
    record status is set to INSERT.

    2. Trying to create a new record in a block using DO_KEY('CREATE_RECORD')
    built-in e.g called from a WHEN-BUTTON-PRESSED trigger associated with a
    button in another block

    Solution Description:

    A call to the 'CREATE_RECORD' built-in should be made after navigating to the
    block based on the database table which will contain the record. For example,
    here is a sample code for the WHEN-BUTTON-PRESSED trigger:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    BEGIN 
     
       GO_BLOCK('blockname'); 
       /** If there are records present in the block, the new record to be 
       inserted after the last record **/
       LAST_RECORD;
     
       IF :SYSTEM.RECORD_STATUS != 'NEW' 
       THEN	  
          DO_KEY('CREAT_RECORD'); 
       END IF;
     
    END;
    3. There can be some perceived inconsistent behaviour when attempting to exit
    a form after issuing an 'insert record'. This relates to whether the insert
    record is in the middle of a block / inbetween existing records or as the last
    record in the block.
    For example:

    (a) Create two records, commit, insert _record to add a record inbetween two
    records but do NOT type in any characters. An attempt to exit is prevented by
    the error FRM-40102. It is necessary to issue a clear_record first before an
    exit from the Form is allowed

    (b) Create two records, commit, insert _record to add a record inbetween two
    records but this time type in some characters into fields.
    An exit is possible after a 'Do you want to save changes' message.

    (c) Create two records, commit, insert_record to be after the last record, but
    do NOT type in any characters. An exit is possible, there are no errors or
    'Do you want to save changes' messages

    (d) Create two records, commit, insert_record to be after the last record, but
    this time type in some characters into fields.An exit is possible after a
    'Do you want to save changes' message.

    (e) Create five records, commit, arrow down and place cursor in row six after
    the last record, but do NOT type in any characters. An exit is possible - no
    errors or 'Do you want to save changes' message

    (f) Create five records, commit, arrow down and place cursor in row six after
    the last record, but this time type in some characters into fields. An exit is
    possible after a 'Do you want to save changes' message.

    Solution Description:

    To work-around scenario (a) use a KEY-EXIT form level trigger with the
    following sample code:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    IF :SYSTEM.CURSOR_VALUE is NULL
    THEN
    SET_RECORD_PROPERTY(:SYSTEM.CURSOR_RECORD, 'T' , STATUS, QUERY_STATUS);
    EXIT_FORM ;
    ELSE
    EXIT_FORM;
    END IF;
    RELATED DOCUMENTS
    -----------------

    Bug 42992 Abstract: INCONSISTANT BEHAVIOUR OF FORM AFTER <INSERT RECORD>
    IN A BLOCK
    Bug 364283 Abstract: CANNOT NAVIGATE TO OPEN FORM IF INSERT RECORD -GET
    FRM-40102

    Note 47233.1 Customizing the 'Do you want to save changes?' Message in Forms

    KEYWORDS
    -------------------
    system.record_status status record insert record exit exit_form insert_record
    clear_record frm-40102 suppress eliminate prevent stop forms 4.5 6i 9i runtime
    error

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Réponses: 6
    Dernier message: 01/07/2010, 18h08
  2. changer libellé d'un bouton dans un bloc multiligne
    Par benji3773 dans le forum Forms
    Réponses: 2
    Dernier message: 04/12/2007, 16h10
  3. [Forms6i] FRM-40737 et Create_timer
    Par lafouine dans le forum Forms
    Réponses: 2
    Dernier message: 22/08/2005, 10h46
  4. probleme espace dans bloc div
    Par piff62 dans le forum Balisage (X)HTML et validation W3C
    Réponses: 6
    Dernier message: 29/04/2005, 16h39
  5. Réponses: 4
    Dernier message: 30/09/2004, 13h55

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo