Reply
Contributor
nathanb
Posts: 3

How Do You Automatically Convert Leads Based On A Field Value?

I'm sure I'm just not using the correct terminology, but I haven't been able to find an answer to the following:

 

I have a lead field that's a checkbox. If that box is checked, I want the lead to be automatically converted to an opportunity. How do I do that?

 

Thanks!!

Super Contributor
jkucera
Posts: 730

Re: How Do You Automatically Convert Leads Based On A Field Value?

Trigger is your best bet to auto-convert a lead when some value = True.  Check out the Apex docs:

 

 http://www.salesforce.com/us/developer/docs/apexcode/index.htm

John Kucera
Product Manager - Salesforce Chatter
Free Chatter Unfollow Rules App
Regular Contributor
RCJesse
Posts: 97

Re: How Do You Automatically Convert Leads Based On A Field Value?

[ Edited ]

jkucera is right. You are going to want to setup an after update lead trigger. That trigger will check every lead after it has been updated to see if the value is true. You will use a Database.LeadConvert instance and Database.convertLead method to convert your lead. Frankly the objects and methods to convert lead are still kind of confusing to me, i just took an example and made it work for me :smileyhappy:

 

There is an example in the reference docs:

http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_dml_convertLead.htm 

Message Edited by RCJesse on 11-05-2009 04:47 PM