Tuesday, March 15, 2016

How to add the "Duplicate Record" functionality to custom forms

Salam Alaikum,

    For those who are not familiar with the "Duplicate Record" functionality, it is a standard functionality added to many forms in Oracle Apps (E-Business Suite) to enhance user entry in many standeard forms. It is triggered once the user enters "Shift + F6" in any tabular data block.

   For a list of all Oracle Apps shortcuts please refer to this post:

   And as explained in "Oracle Applications Developer Giude R12" this functionality is disabled by default for the following reasons:

  1. The special column ROW_ID is duplicated and must be exempted if it exists.
  2. The record is marked as valid even though the items may contain time-sensitive data that is no longer valid.
  3. Defaults are overridden
  4. It doesnt make sense in many scenrios. 
  

 
   But in many cases... you might need to add to add it. It is actually pretty simple. And here are the steps to implement it:


1.    Add the following procedure to the form (you may want to place this code in the Program units), as the following example:

PACKAGE BODY xx_block_name
IS
   PROCEDURE KEY_DUPREC
   IS
      CURSOR new_primary_key
      IS
         SELECT block_name_S.NEXTVAL FROM sys.DUAL;
   BEGIN
     DUPLICATE_RECORD;

     OPEN new_primary_key;
     FETCH new_primary_key INTO :order.block_id;
     CLOSE new_primary_key;

     :order.status  : = 'New';         --- you can add any fixed valur for the new created record
     :order.row_id := null;            --- put null for the ROW_ID
   END KEY_DUPREC;
END xx_block_name;

2.    Create a trigger "KEY-DUPREC"on the data block level and call procedure created.

   Now, test and remeber to keep the client happy all the time :)

  Hope you found it useful guys, feel free to leave a comment if have any note on the subject.        

1 comment:

  1. Regards
    Sridevi Koduru (Senior Oracle Apps Trainer Oracleappstechnical.com)
    LinkedIn profile - https://in.linkedin.com/in/sridevi-koduru-9b876a8b
    Please Contact for One to One Online Training on Oracle Apps Technical, Financials, SCM, SQL, PL/SQL, D2K at training@oracleappstechnical.com | +91 - 9581017828.

    ReplyDelete