Salesforce Visualforce Page

Salesforce

How to make apex:pageblock background white?

Syntax: <apex:pageblock mode="maindetail"> Example: Visualforce page: <apex:page controller="Sample" sidebar="false" ><style type="text/css">    .hideButton{display:none;}</style><chatter:feedWithFollowers entityId="{!contactDetail.Id}"/><apex:form >        <apex:pageblock title="Contact Detail" mode="maindetail">        <apex:pageblockSection columns="4" >            <apex:pageblockSectionItem >                Contact First Name:            </apex:pageblockSectionItem>              <apex:pageblockSectionItem ....

Salesforce

How to display chatter for a record in Visualforce page in Salesforce?

Syntax: <chatter:feedWithFollowers entityId="Id of the record"/> Example: Visualforce page: <apex:page controller="Sample" sidebar="false" ><style type="text/css">    .hideButton{display:none;}</style><chatter:feedWithFollowers entityId="{!contactDetail.Id}"/><apex:form >        <apex:pageblock title="Contact Detail" mode="inlineEdit">        <apex:pageblockSection columns="4" >            <apex:pageblockSectionItem >                Contact First Name:            ....

Salesforce

How to show lookup field in apex:outputfield in Salesforce?

Sample Code: Visualforce page: <apex:page controller="Sample" sidebar="false" ><style type="text/css">    .hideButton{display:none;}</style><apex:form >        <apex:pageblock title="Contact Detail" mode="inlineEdit">        <apex:pageblockSection columns="4" >            <apex:pageblockSectionItem >                Contact First Name:            </apex:pageblockSectionItem>              <apex:pageblockSectionItem >                <apex:outputField value="{!contactDetail.FirstName}">                    ....

Salesforce

Automatic email scheduler to Contacts accosiated with those Opportunities

Batch Class: global class opptyDetails implements Database.Batchable<sobject>{    global Database.QueryLocator start(Database.BatchableContext bc)    {        String soql = 'SELECT Opportunity.Name, Opportunity.OrderNumber__c, Opportunity.Approval_Status__c, Contact.Email, Contact.Name, Contact.Level__c FROM OpportunityContactRole';        return Database.getQueryLocator(soql);    }        global void ....

Salesforce

How clone a record with related records in Salesforce?

Sample Code: Visualforce page: <apex:page controller="Sample" sidebar="false"> <apex:form > <apex:pageblock > <apex:pageblockSection > <apex:pageblockSectionItem >Enter the Account Id:</apex:pageblockSectionItem> <apex:pageblockSectionItem ><apex:inputtext value="{!idOfRec}" /></apex:pageblockSectionItem> </apex:pageblockSection> <apex:pageblockButtons > <apex:commandButton value="Clone" action="{!cloneRec}"/> </apex:pageblockButtons> </apex:pageblock> ....

Salesforce

How to find object type from Salesforce record id?

Sample Code to execute in Developer Console: Id myId = '0035A00003MuvnuQAB';   String sObjName = myId.getSObjectType().getDescribe().getName();   system.debug('Object Name is ' + sObjName);   Output: ( Or ) Sample Code: Visualforce page: <apex:page Controller="sample" sidebar="false" > <apex:form > <apex:pageblock id="pg" > <apex:pageblockSection > <apex:pageBlockSectionItem ....