You need to sign in to do that
Don't have an account?

Validation on the Convert button
Hi,
I need to introduce some simple validation on the Convert button on the Lead object. I have two fields that each need to have a particular value (Lead Status must be Closed- Converted, and a custom picklist field Membership Level must a value chosen)
I understand that this can (should) be done using a trigger, but I'm afraid I don't know how to do that.
I work for a non-profit and we're implementing this ourselves, so would really appreciate some help please.
(My skills are confined to having attended the Admin Essentials course)
Thanks in advance
Martin
Hi,
I believe you need not create a trigger for this.. All you have to do is
Let me know if you need any help.
Cheers!!!
Hi,
just create a new custom button have
display type as: Button
behaviour:Execute JavaScript
OnClick JavaScript: enter your conditions and validations.
after specifying the conditions use this redirect statements:
{!REQUIRESCRIPT("/soap/ajax/14.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/14.0/apex.js")}
if ( /*specify the conditions that you want to define*/)
{
my_URL="{!URLFOR($Action.Lead.Convert ,Lead.Id,[retURL=URLFOR( $Action.Lead.View, Lead.Id)])}";
window.parent.location.href = my_URL;
}
else
{
alert("Lead cannot be converted") ;
my_URL="{!URLFOR($Action.Lead.View, Lead.Id)}";
window.parent.location.href = my_URL;
}
this will allow you to customize the conditions for lead convertion
Regards,
Bharath