Posts

Showing posts from May, 2016

Search Contact Records Using Pagination in apex

Image
Requirement : Create a visual force page create a TextBox for Last Name and another is Mobile Phone when User enter the value then corresponding data should be visible in a table Solution: VFPageCode <apex:page controller="ContactMultipleSearchWithPagenationCLS" action="{!searchcon}">      <script type="text/javascript">         window.onload=function() {         // document.getElementById("{!$Component.thePb.thepbs.conName}").focus();         }        </script>      <apex:form >         <apex:pageBlock id="thePb" title="Contact Details To Search">             <apex:pageblockSection id="thepbs">                 <apex:inputField value="{!con.LastName}" required="false" id="conName"/>                 <apex:inputfield value="{!con.MobilePhone}"/>             </apex:pageblockSection>    

Open related list record on Custom Button Click on Parent Detail Page

Image
Requirement: Open All attachment record on a single button click means that , On Detail page of account there is custom button when click on this custom button open all attachment under the account Solution: Create a Custom Button on Account Level call a javaScript as mention below {!REQUIRESCRIPT("/soap/ajax/24.0/connection.js")}  {!REQUIRESCRIPT("/soap/ajax/24.0/apex.js")}  var query = "SELECT Id, ParentId FROM Attachment WHERE ParentId = '{!Account.Id}'";  var records = sforce.connection.query(query);  var records1 = records.getArray('records');  //alert(records);  if(records1.length>0){  //alert(records1.length);  for(var i=0;i<records1.length;i++){  //alert('Test'+ records1[i].Id);  window.open('/servlet/servlet.FileDownload?file='+records1[i].Id);  }  } Step 1 Create  a custom Button on Account Level and write the JavaScript code as mention above refer the screenshot