Show error message in Visualforce Page using ApexPages.addmessage apex error message Sometime we need to show error message on Visualforce page. We can implement this requirement by creating new instance of ApexPages.message and then adding …

custom label in apex code salesforce example We can use System.Label.labelName to access custom label in apex code. Custom labels are custom text values that can be accessed from Apex classes or Visualforce pages. The …

Pagination using standard set controller salesforce We can use Standard set controllers provided by salesforce to implement pagination in visualforce. It is very easy to implement pagination using standard set controller. We can easily navigate …

public class CheckAllUsingJavascriptController {
public List<wrapAccount> wrapAccountList {get; set;}
public CheckAllUsingJavascriptController(){
if(wrapAccountList == null) {
wrapAccountList = new List<wrapAccount>();
for(Account a: [select Id, Name,BillingState, Website, Phone from Account limit 10]) {
// As each Account is processed we create a new wrapAccount object and add it to the wrapAccountList
wrapAccountList.add(new wrapAccount(a));
}
}
}
public class wrapAccount {
public Account acc {get; set;}
public Boolean selected {get; set;}
//This is the contructor method. When we create a new wrapAccount object we pass a Account that is set to the acc property. We also set the selected value to false
public wrapAccount(Account a) {
acc = a;
selected = false;
}
}
}