Salesforce Visualforce Page

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>        ....

Salesforce

How to create donut chart in Visualforce page using Apex in Salesforce?

Sample code: Visualforce page: <apex:page controller="Graph" >    <apex:pageblock title="Members and their Years of experience" >        <apex:chart height="250" width="350" data="{!pieData}">             <apex:pieSeries tips="true" dataField="data" labelField="name" donut="50"/>             <apex:legend position="bottom"/>        </apex:chart>    </apex:pageblock>            ....