Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Does anyone have an example of doing this via a Trigger? I have no had any luck (or truthfully, been able to FIND help) on how, if Opp is "Closed", to create a record elsewhere (in this case, a new Case tied to the Account).

If someone has links to such working example(s), that would be awesome. I appreciate any guidance offered. I have just enough knowledge to be dangerous on this and cannot trust what I know to do it correctly, and as usual, navigating the developer's site at SF is like a random-order Dictionary or something (to me, at least).

share|improve this question
What have you tried so far? Have you been able to get a trigger to at least fire and verify the stage? – Mike Chale Jan 14 '13 at 14:32
I have code all over the place that can verify that a value exists/etc. What I am totally stumped on is inserting a record (so I can then populate it with whatever field values I want). It's simple stuff, and as my job continues to make me work 8x5 on Admin duties, I tend not to get as much time to research these simple things. I'm going through the Workbooks from the Dev site right now (the Apex book specifically) in an effort to expand my knowledge. (sigh) – AMM Jan 14 '13 at 14:41
up vote 3 down vote accepted

I strongly suggest you to go through Salesforce Developer guide, it should have good working examples to help you. In addition, you can also check various blogs/resources

this one here explains how to insert new record:

share|improve this answer
Thank you VERY much! – AMM Jan 14 '13 at 19:06

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.