Skip to content

Instantly share code, notes, and snippets.

@joshbirk
Last active August 29, 2015 14:15
Show Gist options
  • Select an option

  • Save joshbirk/880e17ce038739b63109 to your computer and use it in GitHub Desktop.

Select an option

Save joshbirk/880e17ce038739b63109 to your computer and use it in GitHub Desktop.
public class DisplayCaseController {
@AuraEnabled
public static Case getCaseFromId(Id caseID) {
if(caseID == null) {
return [SELECT ID, Subject, Description, STATUS from Case LIMIT 1];
}
List<Case> cases = [ SELECT Id, Subject, Description, Status from CASE where ID = :caseID ];
if(cases.size() == 0) {
return [SELECT ID, Subject, Description, STATUS from Case LIMIT 1];
} else {
return cases[0];
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment