Need a snippet to clone a record, its children and its children's children...
I am creating a "template" function where the user will create a parent record, create children of that parent, then create children of those children. That will serve as a template. That part I have down. The part I need is for the user to click a button that will clone the parent, the children, and the grandchildren. I wrestled with declarative options for this, but I hit a wall. One of the complexities is that the record need to be cloned, then the children need to be cloned and associated with the cloned record, not the original. Then the grandchildren need to be cloned and associated with the newly cloned children, not the original children. Has anyone endevored to do such a thing?