Skip to content

Instantly share code, notes, and snippets.

@kiran-machhewar
Created October 21, 2013 03:12
Show Gist options
  • Save kiran-machhewar/7078125 to your computer and use it in GitHub Desktop.
Save kiran-machhewar/7078125 to your computer and use it in GitHub Desktop.
ConsoleController
public without sharing class ConsoleController{
public List<Log__c> logList {set;get;}
public ConsoleController(){
logList = new List<Log__c>();
}
public PageReference refreshLogs(){
String logId = ApexPages.currentPage().getParameters().get('logid');
System.debug('LogId'+logId);
if(logId!=null){
logId=logId.replaceAll('"',''); //Clean the id obtained from page
List<Log__c> logs = [Select Id,Name,Log_Body__c,Log_Type__c,Title__c,User_Name__c From Log__c where Id=:logId];
if(logs!=null&&logs.size()>0){
logList.add(logs[0]);
}
}
return null;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment