
I'm writing trigger code to create a new case if our customer adds a comment to a closed case via the web portal or if they reply to an email to case email.
I just wondered if there was a best practice for created related (child) objects when creating new cases i.e. when you don't have an id to associate the parent and child objects until after you've created the parent cases.
Thanks,
David
2 réponses

Hi,
Thanks for the response, but this doesn't answer my question.
The problem is I want to create a new case (or bunch of cases depending on what causes the trigger to fire) but I also want to create a case comment associated to that new case (or cases). The problem is when you bulkify the code to create a list of cases to insert how can you then associate the case comments to the correct case since you do not have the case id before you do the insert.
Thanks,
David