This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class yearEndCampaignTable implements | |
| Database.Batchable<sObject>,Database.Stateful { | |
| //instance member to retain state across transactions | |
| public static Integer emailLimits; | |
| public Integer recordsProcessed =0; | |
| public Database.QueryLocator start(Database.BatchableContext bc) { | |
| Integer year = Date.Today().year()-1; | |
| return Database.getQueryLocator([SELECT LastName, id,Gifts_Last_Year__c, (SELECT Id, CloseDate, Amount, Campaign.Name FROM Opportunities | |
| WHERE CALENDAR_YEAR(CloseDate) =:year AND IsWon = True ORDER |
OlderNewer