|
Publicité ' | |||||||||||||||||||||||
|
|
#1 | ||
|
Membre du Club
![]() Inscription : mars 2005 Messages : 119 ![]() |
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 :
Qqun a une idée ? Merci ! |
||
|
|
00
|
|
|
#2 |
![]() ![]() ![]() Inscription : mai 2003 Messages : 6 533 ![]() |
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é.
__________________
Rédacteur Oracle (Oracle ACE) Guide Oracle ,Guide PL/SQL, Guide Forms 9i/10g, Index de recherche Je ne réponds pas aux questions techniques par MP Blogs: Forms-PL/SQL-J2EE - Forms Java Beans |
|
|
00
|
|
|
#3 |
|
Membre du Club
![]() Inscription : mars 2005 Messages : 119 ![]() |
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...
|
|
|
00
|
|
|
#4 | ||||||||||
|
Membre du Club
![]() Inscription : mars 2005 Messages : 119 ![]() |
Bon je m'en suis sorti en remplacant
Code :
Code :
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 :
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 :
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 :
----------------- 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 |
||||||||||
|
|
00
|
Copyright © 2000-2012 - www.developpez.com