+ Start a Discussion

Restrict lead conversion

Hello everyone,



I'ld like to restrict the lead conversion when the user is not the lead owner. What's the easiest way?



Thanks in advance


Javier Jiménez

Abante Asesores




You can a validation rule on the lead to restrict the user for conversion of lead.


Try the below validation rule criteria as reference:


AND(OwnerId != $User.Id , IsConverted )


Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved. 



you are having two options to restrict this 


you can override standard Convert button by VF page 

below is VF page code 

<apex:page standardController="Lead" Extensions="CustomConvertor" action="{!Validate}"> 
<script type="text/javascript">
var er='{!Err}';
if(er != '')
	location.href= '/'+'{!recId}';



Apex Code

public with sharing class CustomConvertor 
	public string Err {get;set;}
    public Lead obj ;
    public string recId {get;set;}
    public CustomConvertor(ApexPages.StandardController controller) 
        obj= (Lead)controller.getRecord();
        obj=[Select Id,OwnerId from Lead where Id = : obj.Id];
    public pagereference Validate()
       Pagereference objRet;
       if(obj.OwnerId == Userinfo.getUserId())
        objRet= new Pagereference('/lead/leadconvert.jsp');
       		recId = obj.Id;
       		Err='Unable to convert ';
       return objRet;




Please overide standard convert button by below page



Approach 2: 


Create anather custom button for Lead Conversion with content source as execute javascript


Code is here 


if('{!$User.Id}' == '{!Lead.OwnerId}')
alert('you cant convert this lead');


Please let us know if you face any issue with above code