function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
akshithakshith 

Trigger when Opportunity Stage is "Closed-Won"

Hi All,
 
I am new to Salesforce.com, Please can somebody help me with their suggestions since Apex coding is very new to me.
 
I have a requirement as mentioned below.
 
Need to develop a apex code trigger when Opportunity Stage is "Closed-Won" following takes place:
 
a. Creates a new Contract record.
b. Childs the contract record to the opportunity organisation.
c. Link from contract record to opportunity itself.
d. Maps the values from fields on the opportunity record onto fields in Contract record.
 
"Contract" is a simple custom object and not the sfdc standard object.
 
Any sample code will be really useful.
 
Thanks in Advance,
Ak**bleep**h
RickyGRickyG
Ak**bleep**h

Your requirements are quite easy to implement - you should take a look at the documentation and the chapters on Apex in the new Developer Guide, available as part of the Force.com library here.

Hope this helps.
akshithakshith
Hi Rick,

Thanks for your reply. I am new to this coding and i have been assigned with this work. Thought if someone could help me in this regard. I am going through the documents as well.

Thanks,
Ak**bleep**h
EvanSFEvanSF

Hello Ak**bleep**h

I couldn't have written my situation more precisely than your post! I'm new to apex coding too and trying to follwo documentation. But it woudl really help to see a sample code to get a kickstart on the learning! Since your post was from a while ago, I presume you were able to make progress on your requirement. Can you share that code/sample with me?

Thanks!!!

EvanSF