Create a page like a normal editing page with prefilled items based on the id you branched from. Then instead of updating the old record you submit the page as insert.
Thanks for the help Cris, but I'm not sure how I can do that.
Another thing I found, in Automated Row Fetch (On Load - After Header), in the section "Valid Insert Request Values", I see options INSERT, CREATE, CREATE_AGAIN, CREATEAGAIN?
Do you know what is CREATE_AGAIN for? I was wondering if that is the missing link :-)
I'm completely lost, appreciate any help.
CREATEAGAIN and those other values are just request values upon which the ARF is designed to fire for inserting a row into the table. It's related to the built-in DML for insert. I don't think that's going to help you. I believe it's related to if you want to add a row, submit it, and be left with an emtpy form to add another row. But it's not for creating duplicates.
Back to your original question, and envisioning what you already have (a form, not tabular, where the user edits or creates one row at a time), I think I would do this.
1. Create this new button (sounds like you have).
2. Create a PL/SQL that inserts a new record based on the existing record that's in the form (ensure that the conditions on the existing update DML row processing will not fire when this new button is pressed). You will need to change the value of the PK column(s) though on insert of the new record so you don't get a ORA-00001. This creates a new record in the table.
3. Branch called from this button only should return to this same page and set the new PK values to whatever was just created so when the page returns the user can see the record they just created and make any further changes to it.
I'm going to implement the duplicate button to copy the existing record to become a new record. I did read couples of information in OTN but there are not details and step by step and doesn't show the code behind. Please can you help me how to do this. Thanks in advanced.
create on process on page submit which also insert value again to on your form
select empno into PX_empno from emp where ename=:PX_ename;
which gives you form on edit mode of same records
check jump given to same page.