function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Tulasiram ChippalaTulasiram Chippala 

Need help in record cloning

We have a requirement like below,

Suppose if any Employee owner updates some values on Employee record, it has to generate new Employee with updated values and Active.

And Old employee should be INACTIVE with old values(Not with new values). I tried with different scenarios but not succeeded.

Please help me with this, how I can achieve this. Thanks in advance. 
 
ShirishaShirisha (Salesforce Developers) 
Hi Tulasiram,

Greetings!

You can create the apex trigger after update and create new record with the updated changes and then update the status=false on the old record.

Otherwise,you can create the flow as well to achieve the same if you do not want to do it via code.

Reference:https://trailblazers.salesforce.com/answers?id=9063A000000pY9KQAU

Kindly let me know if it helps you and close your query by marking it as best answer so that it can help others in the future.

Warm Regards,
Shirisha Pathuri