+ Start a Discussion
santhosh  konsanthosh kon 

While creating a new record in opportunity I want to display opportunity stage as closed won using a Trigger?plz send some sample code?

Dushyant SonwarDushyant Sonwar
Hey santhosh,

You can try this sample code to assign  stagename as closed won through trigger
trigger UpdateStage on Opportunity (before insert) {
    for(Opportunity Opp:Trigger.new){
        Opp.stageName='closed won';