Salesforce Visualforce Page

Salesforce

Email validation using Apex in Salesforce

Visualforce page: <apex:page controller="testController">    <apex:form id="myform">    <apex:pagemessages />    <apex:pageBlock id="myblock">        Email Address: <apex:inputText value="{!email}" id="email"/><br/><br/>        <apex:commandButton value="Click me!" action="{!checkEmail}"/>    </apex:pageBlock>    </apex:form></apex:page> Apex Code: public class testController{    public String email { ....

Salesforce

Calling Apex method from a Custom Button

To call Apex method from Custom Button, follow the below steps 1. Create a custom button and enter the following code Syntax: {!REQUIRESCRIPT("/soap/ajax/12.0/connection.js")} {!REQUIRESCRIPT("/soap/ajax/12.0/apex.js")} sforce.apex.execute("Class_Name","Method_Name",{parameter_Name:"value"}); location.reload(true); Code: {!REQUIRESCRIPT("/soap/ajax/15.0/connection.js")} {!REQUIRESCRIPT("/soap/ajax/15.0/apex.js")} var ....

Salesforce

How to display Standard controller Picklist using Apex

The below code is used to display Rating picklist of standard object Account. <apex:page standardController="Account">    <apex:form >        <apex:pageMessages />        <apex:pageBlock >        <apex:pageBlockSection columns="2">            <apex:pageblockSectionItem >                <apex:outputLabel value="Rating"/>            </apex:pageblockSectionItem>        ....

Salesforce

How to disable another checkbox field checkbox if i check one checkbox in checkbox field

Sample Code: Visualforce page: <apex:page controller="sample"><script type="text/javascript"></script>       <apex:form >       <apex:pageMessages />       <apex:pageBlock >        <apex:pageBlockSection columns="2">            <apex:pageblockSectionItem >                <apex:outputLabel value="Metro"/>            </apex:pageblockSectionItem>                   <apex:pageblockSectionItem >                               <apex:inputCheckbox value="{!metro}">                                ....

Salesforce

Dynamically making a field required using Apex in Salesforce

Sample Code: Visualforce Code: <apex:page controller="sample">        <apex:form >        <apex:pageMessages/>        <apex:pageBlock>        <apex:pageBlockSection columns="2">            <apex:pageblockSectionItem>                <apex:outputLabel value="Known City"/>            </apex:pageblockSectionItem>                    <apex:pageblockSectionItem>                                <apex:inputCheckbox value="{!knwCity}">                                 <apex:actionSupport event="onchange" reRender="a"/>                </apex:inputCheckbox>            ....