Posts

Showing posts from May 16, 2015

Custom Section Color at Visual force page

Image
Page Code <apex:page standardController="Account"> <script>     function colorPageBlock(pageblock, color) {     if (pageblock != null) pageblock.firstChild.style.cssText = "background-color: " + color + ";";     } </script> <apex:form >     <apex:pageBlock title="My Content" mode="detail">         <apex:pageBlockSection id="redSection" title="My Content Section" columns="2">             <apex:inputField value="{!account.name}"/>             <apex:inputField value="{!account.site}"/>             <apex:inputField value="{!account.Fax}"/>             <apex:inputField value="{!account.ParentID}"/>             <script>colorPageBlock(document.getElementById("{!$Component.redSection}"), "red");</script>         </apex:pageBlockSection>         <apex:pageBlo

Upload Image and Update Image in Contact Detail Page

Image
Requirement: To Create  a Custom Button on Contact Detail Page when user click on it open a vf page from vf page attach img from local drive and save that img on Notes and Attachement and Populate last updted image on contact detail page: Solution : 1 ) Create a Custom Button on Contact 2) Create A VF Page 3) Create a Formula Field on Contact. Page and Class Code as Mention Below Page Code <apex:page standardController="Contact" extensions="uploadImageController" sidebar="false"> <apex:form > <apex:pageMessages ></apex:pageMessages>     <apex:pageBlock title="Attachment" mode="edit">         <apex:pageBlockButtons >             <apex:commandButton value="Save"             action="{!save}"/>         </apex:pageBlockButtons>         <apex:pageBlockSection collapsible="false"  columns="1" >             <apex:inputHidden