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

Trigger from Clone event
I need to create a trigger that is kicked off when a custom object is cloned. Now I can do this via a before insert trigger on the object, but how would I know that the object is being clone vs a brand new record insertion?
It doesn't look like there is a "iscloned" method on triggers or sobjects. Does anyone have any ideas?
Thanks!
What about a custom "Clone" button, that calls a Visualforce Page, which uses Apex (which has clone functionality built-in).
The Visualforce page doesn't have to much more than a simple page that says "In progress..." to notify the user of processing. And you can use the <apex:page> action attribute to call an apex method when the VF page loads.
I should have mentioned that I realize that is an option. It is, however, not a great solution, just a work around. I will probably have to implement it the way you have suggested.
Salesforce should be able to give us developers the functionality I am looking for, even if it is not currently available. I wanted to use the built-in functionality of the Salesforce clone and just build ontop of it.
I'm faced with the same challenge, has there been any movement on this?
Would be nice to have the platoform tell us (developers) if trigger is being called as a result of a clone, (i.e. isClone)
Create a new custom field, say a checkbox, let's call it Clone__c. Default value is FALSE/unchecked.
Write your after insert trigger as follows: Make sure any user profile that might be cloning records has write access to Clone__c.
Please don't forget to select "best answer" if this works for you.