1

if Lead status = closed and reason = "somthing". after saving the record it should take me to create a new opportunity.

Is it possible with trigger or process builder ?

2
  • 1
    Like a lead convert?
    – EricSSH
    Commented Jan 20, 2016 at 21:59
  • asd EricSSH says - standard and intended SFDC behavior is for the user to click Convert Lead that in turn creates (attaches to) Account, Contact, and Opportunity with Lead fields mapped to fields on Account-Contact-Opportunity. No need to reinvent the wheel
    – cropredy
    Commented Jan 21, 2016 at 0:55

1 Answer 1

0

Yes this is possible. Here is the code :

trigger toOppo on Lead (after update) {

list<lead> l = trigger.new;

for(lead l1:l){

    if((l1.status=='Closed - Converted') && (l1.reason!=' ')){

    opportunity o = new opportunity();
    o.Name=l1.Name;
    o.closeDate=date.today();
    o.StageName='Prospecting';
insert o;

    }

}

}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .