I have a custom list button on contact with behavior as shown below:
And this custom button is added to the contact related list on account
When I select 2 or more contacts and click on custom button, it redirects me to the visualforce page with the selected contacts and everything looks good. I am trying to put a validation (may be javascript alert message) that before redirecting to visualforce page, atleast 2 contacts are selectes.
Here is my visualforce page:
<apex:page standardController="Contact" recordSetVar="Contacts">
<apex:form >
<apex:pageBlock >
<apex:pageBlockTable value="{!selected}" var="con">
<apex:column value="{!con.name}"/>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:form>
</apex:page>
Thanks
Best Answer
I too faced this issue
Try the below method
1) Choose the Onclick Javascript in the content source for custom button
2) Paste the below code for execution of javascript
3) Save the custom button and check
If this solved your problem, Please check this one as accepted answer so it might be easily helpful to someone...