Another Salesforce blog!!!

Salesforce, Apex

March, 2017

how to retain the checkbox selection in visualforce pagination

First off; create a wrapper class in this example I’ll be using Account standard object: Overall big picture: First on the Visualforce page create apex function with two params. Create a SET variable of id’s(Set some name = new Set) Create two properties (get; set; method properties) for Id and another for boolean. Now the […]


ISPICKVAL(Status__c, ‘Pending’) Favorite

false postive

public Boolean isListEmpty { get{ return !(lstEmp==null || lstEmp.isEmpty()); } set; } Favorite

DocuSign for Salesforce

Episode 1 Intro to DocuSign for Salesforce Presented by: Favorite

AD hoc soql query

Constructor: public List<String> lst1Fields {set;get;} public List<String> lst2Fields {set;get;} public List<String> lst3Fields {set;get;} List<custom_object__c> listCustomObject = [soql]; for(custom_object__c c: listCustomObject) { if(string.isEmpty(c.field__c)) { lst1Fields.add(c.field_name); } } public PageReference searchNow(){ String qryStr = ‘SELECT Id’; String conditionStr = ‘ WHERE Name_ID__c = \”+ searchWord +’\” + ‘ OR Name_ID__c LIKE ‘+’\”+ searchWord +’\”; for(String searchField : […]

validate input

public Boolean validateInput(){ if(String.isNotBlank(searchWord)){ searchWord = searchWord.trim(); if(searchWord.length() <3){ ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.INFO, ‘AT_LEAST_3′)); return false; } if(searchWord.isNumeric()){ //if user enters only number add wildcard by default. searchWord =’%’+searchWord+’%’; } return true; }else{ ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.INFO, ‘Please input at least 3 letters or numbers for search ‘)); } return false; } Favorite

keypress 13 – search on enter

Javascript: <script> function searchOnEnter(evt){ var e = evt || window.event; if(e.keyCode == 13){ var searchButton = document.getElementById(‘{!$Component.theForm.pb.pbs.searchButton}’);; return false; } } window.onkeypress = searchOnEnter; </script> Visualforce page: <apex:form id=”theForm”> <apex:pageBlock title=”Search” mode=”edit” id=”pb”> <apex:pageBlockButtons location=”bottom” id=”pbs”> <apex:commandButton id=”searchButton” value=”Search” action=”{!searchnow}” /> </apex:pageBlockButtons> </apex:pageblock> </apex:form> Favorite

setting up ANT for salesforce

If you want to be able to retrieve/deploy code using ANT in the salesforce you would follow the steps below in order to setup: 1) Go to this link: download the .zip archive file. 2) Go to the and download Migration Tool 3) Extract both zip files which is: 4)You […]

Multi-lingual Visualforce email templates

Question link 1) Modified my VF email template and add attribute language=”{!recipient.LanguageLocaleKey}” 2) After doing that I have created Custom Labels as shown below: 3) After creating the Custom Label I just have to plug it in the VF email template as shown below. <messaging:emailTemplate recipientType=”User” language=”{!recipient.LanguageLocaleKey}” relatedToType=”custom_object” subject=”Case report for Account: {!}”> <messaging:htmlEmailBody> <html> […]

Next posts