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

Apex Reopen Case and Copy Previous Comments
I have a trigger that reopens a case and copies all info into a new case number. Anyone know how I can copy the comments out of the old case into the new one?
Here's what you should do:
- after creating the new case, query Salesforce to retrive all the comments related to the original case and put it into a list
- Go through each comment in the list, and perform a deep clone (clone( false, true ); ) on each commnent and add the cloned comment to a new list.
- insert that new list that contains all the new cloned comments