My problem is this. When a user changes the status on a Case object, I want to see if they changed that status to closed. If so, I want to do some checks to see if I am going to allow that.
What I have so far is this
trigger CaseClosed on Case (before update) {
// Check if the trigger's status is being changed to closed.
List<Case> newCases = Trigger.new;
Case newCase;
for( Case c : newCases ) {
if( Case.CaseNumber === c.CaseNumber ) {
newCase = c;
}
}
My issue is that I don't know how to get the Id, CaseNumber, or whatever the unique identifier of a case is. In a trigger I've written previously I was able to use a UserInfo object and do UserInfo.getUserId() in the if statement. However, I don't see anything like that available for Case objects.