You need to sign in to do that
Don't have an account?
Dilyan Dimitrov
How to stop converting Lead to Account in trigger without addError() method
Hi,
I would like to know How to stop converting Lead to Account in before insert trigger without addError() method?
To be more precise what I need to acheve:
1. Stop the process of converting Lead to Account.
2. Display message in the convert Lead to Account page that the respective Lead is not converted.
3. Set and Update the Lead.Status__c field to 'Existing Deal'.
I've tried to achieve the above in before insert trigger and I used addError() method in order to stop the process of converting Lead to Account as well as to dispaly message that the Lead is not converted but the problem is that the addError() method is making a rollback of my changes and I can neither save nor update my changes and records into the Lead database table.
I used @future method as well as a savepoint because I thought it will help me to set and update my changes but that did not help at all. Therefore I decided to start investigating and searching for a feasible way to achive what I want via VF by using controller.
Could you please advise how achive what I want either by using trigger or controller?
Regards,
Dilyan
I would like to know How to stop converting Lead to Account in before insert trigger without addError() method?
To be more precise what I need to acheve:
1. Stop the process of converting Lead to Account.
2. Display message in the convert Lead to Account page that the respective Lead is not converted.
3. Set and Update the Lead.Status__c field to 'Existing Deal'.
I've tried to achieve the above in before insert trigger and I used addError() method in order to stop the process of converting Lead to Account as well as to dispaly message that the Lead is not converted but the problem is that the addError() method is making a rollback of my changes and I can neither save nor update my changes and records into the Lead database table.
I used @future method as well as a savepoint because I thought it will help me to set and update my changes but that did not help at all. Therefore I decided to start investigating and searching for a feasible way to achive what I want via VF by using controller.
Could you please advise how achive what I want either by using trigger or controller?
Regards,
Dilyan
Remove the stock "Convert" button from the Lead Page Layout and replace it with your own button/VF page.
Hi,
Thank you for your answer.
What I would like to know and what I need is to extend the leadConvert class and override the convert button funcionality.
Could you please advise as well as include an example/code on how to extend the LeadConvert class and override the convert button functionality.
Regards,
Dilyan
You cannot extend the native leadConvert class. You can create your own Visualforce/Apex solution that applies your business logic BEFORE you manually call the leadConvert class.