URL Parameters within Apex and Visualforce

Get a URL parameter from a Visualforce page String MyParameter = ApexPages.currentPage().getParameters().get(‘urlparm’); Get a map of URL parameters from a Visualforce page Map UrlParameterMap = ApexPages.currentPage().getParameters(); // check for a specific parameter if (UrlParameterMap.containsKey(‘urlparm’)){ //do something with the parameter… UrlParameterMap.get(‘urlparm’) } Get URL Parameters in a Visualforce page This assumes the URL is looks like … Read more

Apex Loops, The Simple Things

For loop over a map’s keys (KeySet) map MyAwesomeMap; //… other code for (String KeyStr: MyAwesomeMap.keySet()){ system.debug(KeyStr); } For loop over a map’s values map MyAwesomeMap; //… other code for (CustomObject__c AnObject: MyAwesomeMap.values()){ system.debug(AnObject); } For loop over a list list MyAwesomeList; //… other code for (CustomObject__c AnObject: MyAwesomeList){ system.debug(AnObject); } For loop over a … Read more

Report on Field Changes in Salesforce

Tracking field history in Salesforce allows you to report on the original and new values of a field. This functionality can be very useful when determining who changed a field value and when it happened. This built-in change tracking has some limits:

  • Only the following standard objects allow field history tracking: Accounts, Cases, Contacts, Entitlements, Service contracts, Contract line items, Contracts, Leads, Opportunities, and Solutions
  • Only 20 fields may be tracked per object
  • Not all field types can be tracked

Read more