Skip to content

Instantly share code, notes, and snippets.

@capeterson
Created June 7, 2012 00:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save capeterson/2885596 to your computer and use it in GitHub Desktop.
Save capeterson/2885596 to your computer and use it in GitHub Desktop.
Replication of an issue with enum quality after summer12 salesforce upgrade.
global class LolEnums implements Database.batchable<sObject>, Database.Stateful{
public enum Places {FIRST, SECOND, THIRD}
public Places val;
global Database.QueryLocator start(Database.BatchableContext bc) {
val = Places.FIRST;
return Database.getQueryLocator('SELECT id FROM User');
}
global void execute(Database.BatchableContext BC, List<sObject> work){
System.assertEquals(val,Places.FIRST);
}
global void finish(Database.BatchableContext BC){
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment