Salesforce Visualforce Page

Salesforce

How to add help text or help bubble in Visualforce page?

Sample Code: Visualforce page: <apex:page sidebar="false" Controller="Sample" showHeader="true"><apex:form ><apex:pageBlock >    <apex:pageBlockSection >        <apex:pageBlockSectionItem helpText="Name of the Account" LabelTitle="Account Name">            <apex:outputtext >Enter the Account Name</apex:outputtext>            <apex:inputtext value="{!Name}" />        </apex:pageBlockSectionItem>            </apex:pageBlockSection>    ....

Salesforce

How to display a custom button when checkbox is checked in Salesforce?

Sample code: Visualforce page: <apex:page controller="Sample" ><apex:form >    <apex:pageBlock id="pg" >        <apex:pageblockSection >            <apex:pageblockSectionItem >Check it to view the button:</apex:pageblockSectionItem>            <apex:pageblockSectionItem >                <apex:inputCheckbox value="{!option}" >                    <apex:actionsupport event="onclick" action="{!change}" reRender="pg"/>                </apex:inputCheckbox>                ....

Salesforce

How to send picklist values from one VF page to another?

Sample codes: First Page and its Controller: <apex:page controller="Sample" ><apex:form >    <apex:pageBlock >        <apex:pageblockSection >            <apex:pageblockSectionItem >Select the value to pass:</apex:pageblockSectionItem>            <apex:pageblockSectionItem >                <apex:selectList size="1" value="{!option}" >                    <apex:selectOption itemValue="red" itemLabel="Red"/>                    ....

Salesforce

Age calculation using Apex and Visualforce

Sample code: Visualforce page: <apex:page controller="Sample" ><apex:form >    <apex:pageblock >        <apex:pageblockSection >            <apex:pageblockSectionItem >Date:</apex:pageblockSectionItem>            <apex:pageblockSectionItem ><apex:inputtext onfocus="DatePicker.pickDate(true, this , false);" value="{!dat}" id="dt"/></apex:pageblockSectionItem>            <apex:pageblockSectionItem >Age:</apex:pageblockSectionItem>                                    <apex:pageblockSectionItem ><apex:outputText value="{!age}" /></apex:pageblockSectionItem>                    ....

Salesforce

apex:outputLink in Salesforce

Sample code:Visualforce page:<apex:page controller="Sample" ><apex:form >    <apex:pageBlock >        <apex:pageblockTable value="{!usrs}" var="u">            <apex:column >                <apex:outputLink target="_blank" value="/{!u.id}">{!u.Name}</apex:outputLink>            </apex:column>        </apex:pageblockTable>    </apex:pageblock>    </apex:form>    </apex:page>Apex Controller:public class Sample {     public String obj;    public ....

Salesforce

How to retrieve fields based on selected object by Dynamic Apex?

Sample Code: Visualforce page: <apex:page controller="Sample" ><apex:form >    <apex:pageBlock >        <apex:pageBlockSection >            <apex:pageBlockSectionItem >                <apex:outputLabel value="Objects"/>            </apex:pageBlockSectionItem>                    <apex:pageBlockSectionItem >                <apex:selectList size="1" value="{!obj}" >                    <apex:selectOptions value="{!objs}"/>                </apex:selectList>            </apex:pageBlockSectionItem>                              </apex:pageBlockSection>        ....