Posts

Showing posts from May 23, 2015

Wild Card Searching SOQL in Salesforce

Image
Requirement : Data Filter Based on any Character  Page Code <apex:page controller="wildcardController">   <apex:form >     <apex:pageblock >                  <apex:inputtext value="{!inputtext}"/>         <apex:commandbutton value="Search" action="{!searchRecords}" reRender="ss,msgid"/>     </apex:pageblock>     <apex:pageblock id="pbId">       <apex:pageblocktable value="{!accList}" var="acc" id="ss">         <apex:column value="{!acc.name}"/>         <apex:column value="{!acc.accountnumber}"/>       </apex:pageblocktable>     </apex:pageblock>     <apex:outputLabel value="{!str}" id="msgid"></apex:outputLabel>   </apex:form> </apex:page> Class Code Public class wildcardController {     Public string inputtext{get;set;}     Public List

Filter Contact Based on Account

Image
Requirement : Created a VF Page . Show All Accounts on Drop Down List, When Select Account then related contacts with that Account should be visible in table. Solution :   Create a VF page and Controller Class as mention below Page Code <apex:page controller="ControllerforAccount">  <apex:form >      <apex:pageBlock >          <apex:pageBlockSection columns="1" title="Account">                              <apex:selectList value="{!selectedAccountId}" size="1">              <apex:selectOptions value="{!lstSelectOption}"></apex:selectOptions>           <apex:actionSupport event="onchange" action="{!AllContact}" reRender="contactlistId,outputID"/>       </apex:selectList>               <apex:outputLabel value="{!strMessage }" id="outputID"></apex:outputLabel>