You need to sign in to do that
Don't have an account?
itdept
Overriding the convert button on lead using Visualforce
I have a situation where I'd like to solve using Visualforce, but i think it's do-able with Javascript as well. Here's the situation:
We have a couple of different record types for Leads, record type A, and record type B. Each record type is for a different process. We need the "Convert" button for the Lead object to have the "create opportunity" checkbox CHECKED if the lead being converted is of record type A. We need to have the "create opportunity" checkbox UNCHECKED if the lead being converted is of record type B. How can I override the "Convert" button using Visualforce? I'm sure Visualforce can handle conditionals and redirect the url to the right location...
Thanks in advance!
-Frank
We have a couple of different record types for Leads, record type A, and record type B. Each record type is for a different process. We need the "Convert" button for the Lead object to have the "create opportunity" checkbox CHECKED if the lead being converted is of record type A. We need to have the "create opportunity" checkbox UNCHECKED if the lead being converted is of record type B. How can I override the "Convert" button using Visualforce? I'm sure Visualforce can handle conditionals and redirect the url to the right location...
Thanks in advance!
-Frank
<pre>
<apex:page standardController="Lead">
<script>
if({!Lead.RecordType.Name="RecordTypeA"}) {
window.top.location.href = "/lead/leadconvert.jsp?nooverride=1&id={!Lead.Id}&nooppti=0"; // 0 clears the box
} else {
window.top.location.href = "/lead/leadconvert.jsp?nooverride=1&id={!Lead.Id}&nooppti=1"; // 1 checks the box
}
</script>
</apex:page>
</pre>