check the entry of duplicate data in the block record multi, which is a required field

Hi all
I have a situation where I have to check duplicate data entry (on a domain, which is a field, i.e. mandatory. it cannot be ignored by the user without entering a value) in key-in data in a Multi Record block.

With regard to the reference I used logic, such as
1 > trigger in a when-validate-Record of this block I assign the value of the current element in the variable of type array (collection type)
as this trigger every time I leave this record, so its by assigning the value of the current time. And this process continues

then
2 > wrote in a when-validate-item trigger of the corresponding element (i.e., the relaxation is at the element level), where he compares the value of the current item and the value stored in the variable of type table trigger when-validate-Record (type of collection). If the value of the current element is mapped to a value stored in the variable of type table I shows following message ("Duplicate Record") raise_form_trigger default


This code works very well for the double value of this record multi field check

The problem is that if the user enters the value of this field and then go to the next field, enter the value in this field, and then press 'Enter Query' icon, Validate bolt trigger fires. As a result first when - validate record fires, that stores this value, and then when-validate-point fire, so it shows message duplicate record


Please give me a code or a logical sense to solve this problem



Any other logic to solve this problem is also welcome

If you query the data and it shows two unique values in the block, then it should work as expected. But if you don't ask and just open form and try to insert the record and then for the first record it does not display this message of duplication. For this, you can write your own query to check the duplication of table.

For the image of the form, you can use any image download site. A search on google.

-Clément

Tags: Oracle Development

Similar Questions

  • activation and deactivation of the button in the block record multi

    Hi all
    I use
    Forms [32 bit] Version 6.0.8.24.1 (Production)
    Oracle Database 10g Release 10.2.0.1.0 - Production
    I have a multi record block each block contains a button (the button is to approve the record in terms of change of status)
    I have elements such as the date, remarks and button
    the button should be enabled if the remarks is not null in the case otherwise it should be disabled.
    I wrote to this effect in the pre-record trigger
    if :record is null then
       set_item_property('button',enabled,property_false);
    else
          set_item_property('button',enabled,property_false);
    end if;
    What problem is enable and disable has repercussions on all the buttons in the block. in other words, if the remarks of the first record is null then all records button is disabled. If the observations of the first record column is not null, then all the records in the column of buttons is enabled.
    I have to enable and disable the button for the corresponding record.that ways if the remarks of the first record column is not null not so only records first button should be activated and others should be disabled.

    Thank you...

    Hello

    but I'm not able to do.

    You can find the current record Y_POS 
    

    This means that whatever the user record navigates according to whether the button position gets her past set.but not.
    for example the user navigates up to the fourth record that will settle the position of the button but if user navigates back to the first record. the position of the button is going to the fifth record?

    V_ITEM_Y_POS: = GET_ITEM_PROPERTY ("NOM_ELEMENT", Y_POS);

    Please note that do not use the button element to get the Y_POS.
    This should be another element in the block, then button as a buttons position will continue to change on
    What you are to get the Y_POS of button which is the fourth position of the record for the first time so, it is fair,
    second time you set Y_POS button which is 4th record + first recording which is the fifth album,.
    you need to find is the Y_POS from a fixed point in the block.

    in your description what do you mean by top_record. Why I ask, is because it is multi record block(showing_10_records).so will appear every 10. no record may be hiding.

    Top of page record is the first record in the block.
    For example, in a record 10 block, if there are 20 records then if you navigate the records, if you go to the 11th, 12th, 13th, 14th... the other then your TOP_RECORD be record No 2, 3, 4,... is the first record that is displayed in the block that is not always 1, and will be 1 only for the first 10 rcords.
    If we use: system.cursor_record we will not be able to get the Y_POS exact numbers of superior record then 10 which will put the button located under the last (10th) record, which is not what we want, so need to find the TOP_RECORD.

    Best regards

    Arif Khadas

  • How to check the block that you are in?

    Hello, I was just wondering is there any method to check the block that you are in. I tried

    If: systerm.current_block = < block_name > then...


    but it doesn't seem to work. I guess I'm doing something wrong?

    Thank you.

    It should work anyway... Make sure you compare with the name of block at the top of case. for example

     if :system.cursor_block = 'YOURBLOCK' then
      ....
      ....
     end if;
    
  • How to check the values in multi-record block. ?

    Hello

    I'm new to forms. I have the field titled "Comments" in the block of multi-record. I have a button called "reject". Reject button is in the control block. If I press the button reject, field comments must be entered in one of the record. Otherwise, he should tell message. How to check the multi-record block. ?

    Pl.Help.

    Thanks in advance.
    Mano

    Mano,

    Add NEXT_RECORD just before the END of the LOOP.

         GO_BLOCK('');
         FIRST_RECORD;
         LOOP
              IF NVL(:., ' ' ) = ' ' THEN
                   MESSAGE('');
                   RAISE FORMS_TRIGGER_FAILURE;
              END IF;
              EXIT WHEN :SYSTEM.LAST_RECORD = 'TRUE';
              NEXT_RECORD;
         END LOOP;
    

    Kind regards

    Manu.

    If my response or response from another person was helpful, please mark accordingly

  • How to check the previous records on a select

    I have a query that returns the data as follows
    COL1     COL2     WK_DATE     INDICATOR
    2     2     01/16/2010     A
    0     0     01/16/2010     
    0     0     01/16/2010     
    1     1     11/06/2010     B
    0     0     11/06/2010     
    0     0     11/06/2010     
    1     1     11/20/2010     C
    0     0     11/20/2010     
    0     0     11/20/2010     
    2     2     05/12/2012     C
    2     2     05/12/2012     A
    3     3     05/12/2012     B
    But the data set is incomplete, as I could not fill indicator on null values
    Could you please let me know the service which will be useful for this condition

    ALL I NEED IS JUST TO BRING THE ABSENT ON THAT PARTICULAR DATE INDICATOR

    The expected output is
    COL1     COL2     WK_DATE     INDICATOR
    2     2     01/16/2010     A
    0     0     01/16/2010     B
    0     0     01/16/2010     B
    1     1     11/06/2010     B
    0     0     11/06/2010     A
    0     0     11/06/2010     C
    1     1     11/20/2010     C
    0     0     11/20/2010     B
    0     0     11/20/2010     A
    2     2     05/12/2012     C
    2     2     05/12/2012     A
    3     3     05/12/2012     B
    Thank you

    user12236189 wrote:
    Thanks, I got it lag and partition by with a nested query

    There is no need of LAG. Just change the nested table:

    select  nvl(b.COL1,0) as COL1,
            nvl(b.COL2,0) as COL2,
            b.WK_DATE,
            a.Column_Value Indicator
      from      table(sys.odciVarchar2List('A','B','C')) a
            Left Join
                (
                 select  COL1,
                         COL2,
                         WK_DATE,
                         Indicator
                   from  data_table
                ) b
              partition by (b.WK_DATE)
              on (b.Indicator = a.Column_Value)
      order by b.WK_DATE,
               b.Indicator,
               a.Column_Value
    /
    

    Now:

    SQL> with data_table as (
      2                      select 2 col1,2 col2,to_date('01/16/2010','mm/dd/yyyy') wk_date,'A' indicator from dual union all
      3                      select 1,1,to_date('11/06/2010','mm/dd/yyyy'),'B' from dual union all
      4                      select 1,1,to_date('11/20/2010','mm/dd/yyyy'),'C' from dual union all
      5                      select 2,2,to_date('05/12/2012','mm/dd/yyyy'),'C' from dual union all
      6                      select 2,2,to_date('05/12/2012','mm/dd/yyyy'),'A' from dual union all
      7                      select 3,3,to_date('05/12/2012','mm/dd/yyyy'),'B' from dual
      8                     )
      9  select  nvl(b.COL1,0) as COL1,
     10          nvl(b.COL2,0) as COL2,
     11          b.WK_DATE,
     12          a.Column_Value Indicator
     13    from      table(sys.odciVarchar2List('A','B','C')) a
     14          Left Join
     15              (
     16               select  COL1,
     17                       COL2,
     18                       WK_DATE,
     19                       Indicator
     20                 from  data_table
     21              ) b
     22            partition by (b.WK_DATE)
     23            on (b.Indicator = a.Column_Value)
     24    order by b.WK_DATE,
     25             b.Indicator,
     26             a.Column_Value
     27  /
    
          COL1       COL2 WK_DATE   INDICATOR
    ---------- ---------- --------- ----------
             2          2 16-JAN-10 A
             0          0 16-JAN-10 B
             0          0 16-JAN-10 C
             1          1 06-NOV-10 B
             0          0 06-NOV-10 A
             0          0 06-NOV-10 C
             1          1 20-NOV-10 C
             0          0 20-NOV-10 A
             0          0 20-NOV-10 B
             2          2 12-MAY-12 A
             3          3 12-MAY-12 B
    
          COL1       COL2 WK_DATE   INDICATOR
    ---------- ---------- --------- ----------
             2          2 12-MAY-12 C
    
    12 rows selected.
    
    SQL> 
    

    SY.

  • Query to check the changed records

    Hello
    I have a situation, one of my user ran the loading on the production database and somehow loading does not have its sequence and open screens and he wasn't supposed to. Today, we discovered that some key records of Nomenclature has been modified and diagnose the problem of the Last_updated_by column and user name points to a session of the same user. The conclusion is that loading may have changed other records too.
    To resolve this problem, I need SQL code that will give me a list of all tables / records in the database that have been modified by the user at a given date.
    Can someone please tell me I am sure to get the name of the table of all_tables things work or not different in 11i applications?

    Thank you
    Aali

    Published by: Estelle on May 9, 2011 01:41

    You can be chilly.
    In general (but), when a load of data is not synchronized, it is rare that it will affect independent entities (except if you had the ALT key in the load file).

    Which screens were performing the load? Were they bom screens?
    You can use the following

    SELECT    'select count(1) '
           || table_name
           || ' from '
           || owner
           || '.'
           || table_name
           || ' where last_update_date > sysdate - 1 and last_updated_by = 11531;'
      FROM all_tables AT
     WHERE EXISTS (
              SELECT 1
                FROM all_tab_columns atc
               WHERE atc.table_name = AT.table_name
                 AND atc.owner = AT.owner
                 AND atc.column_name = 'LAST_UPDATED_BY')
       AND EXISTS (
              SELECT 1
                FROM all_tab_columns atc
               WHERE atc.table_name = AT.table_name
                 AND atc.owner = AT.owner
                 AND atc.column_name = 'LAST_UPDATE_DATE')
       --AND owner IN ('AP','GL','AR','FND')
    

    Add code to refine the list above, otherwise, it returns the records too.

    Hope this helps,
    Sandeep Gandhi

  • trigger check the previous record of line before insert/update

    Hi all

    I would like to create a trigger that a customer will not be able to create a new account, if it has a status of "Non-payment".

    CustomerID custNRIC paymentStatus

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

    Non-payment of 200 F7654323A

    It will reject the following statement.

    insert into customer (custID, custNRIC, paymentStatus) VALUES (201, 'F7654323A', 'Good');

    so, how can I go around to solve this issue?

    sqlnoob wrote:

    Hi all

    I would like to create a trigger that a customer won't be able to create a new account, if it has a "Non-payment" statusYou

    You can't do things like that in a trigger.

    It will reject the following statement.

    insert into customer (custID, custNRIC, paymentStatus) VALUES (201, 'F7654323A', 'Good');

    The trigger would dismiss as EVERY other row in the same transaction, if you try to use a trigger.

    You can't stop a trigger to run except by raising an exception and the trigger stop from doing anything for ANY line that the trigger activated on.

    together to define

    CREATE OR REPLACE TRIGGER reject_new_account

    AFTER INSERT OR update ON the client

    FOR EACH LINE

    DECLARE

    PRAGMA AUTONOMOUS_TRANSACTION;

    totover NUMBER (3);

    BEGIN

    SELECT COUNT (*)

    IN totover

    OF THE customer

    WHERE: NEW.nric = customer.nric

    AND: NEW.badstatus = "Non-payment";

    Why are you tring to use an autonomous transaction? All that makes the transaction will NOT be part of the transaction that fired the trigger.

    I know there is a problem with the line 13 ' AND: NEW.badstatus = "Non-payment".»

    so, how can I go around to solve this issue?

    This is the LEAST of your problems. Do NOT try to nontransactional things in a trigger.

    Also, don't try to query the table that the trigger is activated on.

    This is the fundamental question: Oracle is a multi-user system. Other users may be perform DML on the same table at the same time. So any NUMBER that provides this trigger can turn out to be inaccurate when other users post their transactions.

    The best you can do in a trigger is throw an exception. If you do this will affect the complete relaxation and all the lines he treated - not only one line you see that you want to reject.

    A requirement like yours needs to be satisfied by the presence of DML performed using functions or procedures and serialize the customer INSERT/update this transaction that a SINGLE session/user/can perform DML on the table for a client given.

  • How can I change an icon based on data in a block of multi line?

    I have a pack of multi line and I would like to change the appearance of an icon, a particular field based on that data, is - it possible using APEX (3.0.0) or y at - it an equivalent Java script?

    Hello

    Look at this blog entry, he describes how you do with the reports:

    [http://apex-at-work.blogspot.com/2008/09/report-with-changing-icons-on-row-level.html | http://apex-at-work.blogspot.com/2008/09/report-with-changing-icons-on-row-level.html]

    Kind regards

    Tobias
    -----
    [http://apex-at-work.blogspot.com/]

  • Alert to be fired only for the first record, when there are duplicate entries

    Hello

    This is related to the fact of Oracle 10 g.
    I have a block record multi in which I entered and save some codes, something like below

    Code Description
    =====================
    AAAAAAAAAAAA ABCD
    BBBBBBBBBBBBB PQRS
    GENEVIEVE DAVIS
    ABCD DHGFKSDHKSHG
    PQRS DFJHHGS
    EEEE SDT85604ET
    =====================

    Now I need to post a warning/msg to go when-validate-the field Code. So now if I'm on the first record, the alert/msg will appear for code ABCD which is Ok. Now, on the next album, I get a different code PQRS as indicated above, the new alert appears which is Ok. If I enter a code that has been previously entered into the record block multi and alert/msg had been exposed to the only first alert/msg need is not displayed now know if I enter ABCD again the fourth record, the alert should not be displayed.
    Note that this must be done at the time of data entry itself. I guess that maybe it can be done by using groups Records / table plsql.

    Help with a way to solve this matter will be highly appreciated...

    Thank you and best regards...

    As you have already guessed, you must be able to keep track of how many times a value has been entered. If you know what all the possible values of 'CODE' at design time, you can create a counter for each value variable, but it would be a total pain. A better solution would be to permanently keep a total dynamics you can quickly check against. For this I recommend you use a group of registration of forms. Take a look at the demo of Forms - record group treatment (duplicate values check) I wrote. Using the packet of forms Rec_Group condition in this demo, you can easily change the process listed in the working document in your scenario. Follow all the steps in the demo. For your situation, you must change the when-validate-Item trigger so that instead of checking the dupicates and omitting the form if a duplicate is found, you check the number of entries to a value in the record group and display a message if the number is 0 or not to display a message if the number is greater than 0. Your modified WVI trigger might look like this:

    DECLARE
       ignore     NUMBER := 0;
       bignore   BOOLEAN := FALSE;
    BEGIN
       IF ( :YOUR_BLOCK.CODE IS NOT NULL ) THEN
          ignore := Rec_Group.Get_Number(Rec_Group.rg_name, :YOUR_BLOCK.CODE);
          IF ( ignore = 0 ) THEN
              -- Display your message
          ELSE
              -- Don't display any message
          END IF;
          /* add the code to the record group */
          bIgnore := Rec_Group.Add_Value(rec_group.rg_name, :YOUR_BLOCK.CODE, :system.trigger_record);
       END IF;
    END;
    

    Hope this helps,
    Craig B-)

    If someone useful or appropriate, please mark accordingly.

    Published by: Silvere March 30, 2011 15:07

  • How to check the column updated whereby the package or procedure?

    Hi all

    Can someone help me how to check the column updated by which the package or procedure

    A.Mahesh

    Hello.

    You can check what object is a reference to the table of the column:

    Select *.

    of all_dependencies d

    where d.REFERENCED_NAME = '. '

    And you can find all the links to the object source data column:

    Select *.

    of s all_source

    where s.name = "."

    and s.OWNER = '. '

    and s.TYPE = "."

    and as s.TEXT '%%'

  • How to check the key is oem?

    How to check the key is oem?

    And how to check the key belongs to which company, dell hp...?

    This is possible if the license is installed.

    When it is installed, you can proceed as follows:

    Click Start, right click on computer

    Click on properties

    Scroll down to the Windows Activation

    The product ID will contain - OEM-

  • Need to set the attribute of the current record based on the value of the next record

    With the help of forms 6, I have a form that displays the list of folders. There may be multiple records with the same ID, but with different expiration dates. I need set attributes for hilite only the record with the latest expiration date. The current list points of interest reviews of future expiration dates - but we found that, sometimes, the subscription is renewed before the expiration date has been reached, causing two records with the same ID with expiry dates in the future.

    I can (and do) sort the records by date of expiry and the identification for the record with the latest expiration date is always the last to this ID, so what I want to do is to check the next record to see whether or not it has a different ID. If the current record is the last expiration date, & must be hilited. Because I might want to hilite the current record, I can't simply navigate to another record, according to the description I found, what makes the next_record builtin. Anyone know how I can check for a value in the next record without making the current record?

    Thank you.

    What I would do:

    -Create a DB view based on your table and including the function call DRIVE as a separate column.
    -Base that block you on this point of view
    -If the block is modifiable, set the DML target for the block to your database table.

  • possible to check next or previous registration data?

    Hi, currently my code loop through a folder and I was wondering if there was anyway I could check the previous value or next for a given field in this folder in? any help is greatly appreciated.

    As I showed you above; Add the offset (previous value) and lead the analytical functions (next value) to your query in the cursor and use the results of these functions in your loop.

    GAL: http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/functions070.htm#SQLRF00652
    lead: http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/functions074.htm#SQLRF00656

    of course, I can't guarantee if these features are available in your unknown oracle version ;)

    see you soon

  • How to use Spry validator without obtaining all the required fields

    Hello

    I have a problem with a form were I use the Spry validator, I want only 4 required fields but now all fields are required and I don't know why.

    Thanks for your help!

    I finally have my answer using this tutorial:

    http://www.YouTube.com/watch?v=EdkQUEpLHdk

    Have a nice day!

  • How can I check the NDP project duplicate name?


    Hi all

    I would like to know how I can check the NDP duplicate project name? I find that some NDP is initiate serveral times with the same or similar user name name. Assuming that the name of the project was "Smart Pilot". I've always found that this project can type differently as "Smart DRIVER", "smart pilot" or even "Smart drivers. Assuming I want to validate all these name before saving by using validation or custom validation infrastructure. Is this possible?

    Assuming that it was possible, can you please guide me on the way?

    Thank you very much in advance for the entire response.

    Phaithoon W.

    Here is some examples of code for a fast validator. Note that this uses a hard coded English error message, rather than a translation. If you want to use translations instead, look at a few examples in the folder ReferenceImplementations\Validation\SourceCode\ReferenceValidation of the pack of extensibility and review the training of Validation as well as (in the ReferenceImplementations\Validation\Documentation folder).

    Note that the code provided is only for demonstration purposes and is not supported by Oracle.

    Classes:

    using System;
    using System.Data;
    using System.Xml;
    using Xeno.Data.NPD;
    using Xeno.Prodika.Application;
    using Xeno.Prodika.Services;
    using Xeno.Prodika.Validation;
    using Xeno.Prodika.Validation.Validators;
    
    namespace Oracle.Agile.PlmProcess.Validation
    {
        public class NPDUniqueProjectNameValidatorFactory : XmlConfigValidatorFactoryBase
        {
            protected override IValidator Create_Internal(XmlNode configNode)
            {
                return new NPDUniqueProjectNameValidator();
            }
        }
    
        public class NPDUniqueProjectNameValidator : BaseValidator
        {
            private const string sql = @"select 1 as dup from NPDPROJECTML where UPPER(title) = UPPER ('{0}') and FKPROJECT <> '{1}' and LANGID = {2}";
    
            public override bool Validate(IValidationContext ctx)
            {
                var project = ctx.ValidationTarget as INPDProjectDO;
                bool hasDuplicate = false;
                string sqlToExecute = String.Format(sql, project.ProjectML.Title, project.PKID, UserService.UserContext.User.PreferredLanguage);
                using (IDataReader reader = AppPlatformHelper.DataManager.newQuery().execute(sqlToExecute))
                {
                    if (reader.Read())
                    {
                        hasDuplicate = true;
                    }
                }
    
                if (hasDuplicate)
                    ctx.AddError(String.Format("A project already exists with the name '{0}'.", project.ProjectML.Title));
    
                return hasDuplicate;
            }
    
            private IUserService UserService
            {
                get { return AppPlatformHelper.ServiceManager.GetServiceByType(); }
            }
        }
    }
    

    Then, add the following to the ValidationSettings.xml file in config\Extensions:

    1. Add the validator factory, with a reference name in the config:

    
            
            
    
    

    2. Add a rule for NDP project save the event:

    
                
                    
                
    
    

    Compile the example reference in a dll and add this dll in web\npd\bin

    When you try to save a project with a duplicate name, it should now give you the error message.

Maybe you are looking for