You need to sign in to do that
Don't have an account?
Terri Henry
Adding Validation to Custom Lead Button
Hi All!
I currently have a button on the 'Lead' page, that opens a VF page with a Flow inside:
VF Page:
<apex:page standardController="Lead"> <h1>Create A Premier Quick Task</h1> <flow:interview name="QuickPremierTask" finishLocation="/{!id}"> <apex:param name="LeadID" value="{!ID}"/> <apex:param name="UserID" value="{!$User.Id}"/> </flow:interview> </apex:page>
I want to add Validation in the button code that will only allow the button to be clicked (to launch the VF page flow) if the fields 'Lead Source' or 'Initial Lead Source' are equal to the text 'Premier 1'
Normally I would simlpy exclude the button from the page layout with the use of a new Record Type, however this is not an option in this instance.
Can this be done using Javascript in the button code? (Or an alternate option)
Winning answer gets 10 internets!
I currently have a button on the 'Lead' page, that opens a VF page with a Flow inside:
VF Page:
<apex:page standardController="Lead"> <h1>Create A Premier Quick Task</h1> <flow:interview name="QuickPremierTask" finishLocation="/{!id}"> <apex:param name="LeadID" value="{!ID}"/> <apex:param name="UserID" value="{!$User.Id}"/> </flow:interview> </apex:page>
I want to add Validation in the button code that will only allow the button to be clicked (to launch the VF page flow) if the fields 'Lead Source' or 'Initial Lead Source' are equal to the text 'Premier 1'
Normally I would simlpy exclude the button from the page layout with the use of a new Record Type, however this is not an option in this instance.
Can this be done using Javascript in the button code? (Or an alternate option)
Winning answer gets 10 internets!
All Answers
Use the code below as a template, it will need some tweaking As a common practice, if your question is answered, please choose 1 best answer.
But you can give every answer a thumb up if that answer is helpful to you.
Thanks