You need to sign in to do that
Don't have an account?

Deep, Deep Cloning and URL.
Basically I need to do a recursive clone of an object and all it's children.
I was initially hoping to intercept the standard clone event using a trigger, and capture the clone variable in the query using:
URL.getCurrentRequestUrl().getQuery());
hoping to find "clone=1" somewhere in the string, but it only returns a null, so I am assuming there is a page redirect or such before the trigger is executed.
any suggestions on how to best catch the 'clone' so that I can do my thing and clone all the related items?
You can create a custom button, custom visual force page and controller. This will replace standard Clone button.
In this controller you use sobject clone method to deep clone you source object.
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_methods_system_sobject.htm
All Answers
Welcome to community Mr. Critter.
I am afraid to say that I could not understand what exactly you want to do?
I have a top level object: Projects
When a project is cloned, I need to clone everything that is attached to that Project. Currently cloning just clones the Project itself.
I wanted to intercept the standard clone of a project so that I could loop through everything attached to it and clone them...
I was hoping to use the URL to see if the url contained 'clone=1', which is what is shown when cloning an object, but that doesn't work..
Was curious if there are any other ways to 'intercept' a clone event..
ps. thank you for the welcome :)
You can create a custom button, custom visual force page and controller. This will replace standard Clone button.
In this controller you use sobject clone method to deep clone you source object.
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_methods_system_sobject.htm
That is what I figured I would have to do. I was just hoping there would be a way to 'intercept' the standard clone feature.
Thanks.