Skip to content

Instantly share code, notes, and snippets.

@pcon
pcon / template.java
Created May 22, 2012 18:57
Pcon trigger template.java
public class OrderTrigger {
private final Map<Id, Order__c> oldMap;
private final Map<Id, Order__c> newMap;
private final List<Order__c> newObjs;
private final Boolean isInsert;
private final Boolean isUpdate;
private final Boolean isDelete;
private final Boolean isBulk;
/**
@pcon
pcon / ServiceRequestTrigger.java
Created May 30, 2012 18:01
Checking previous status != 'In Review' and then switched to 'In Review' - field expression now allowed for generic SObject line 33
public class ServiceRequestTrigger {
private final Map<Id, Service_Request__c> oldMap;
private final Map<Id, Service_Request__c> newMap;
private final List<Service_Request__c> newObjs;
private final Boolean isInsert;
private final Boolean isUpdate;
private final Boolean isDelete;
private final Boolean isBulk;
/**
@pcon
pcon / ServiceRequestTrigger.java
Created May 31, 2012 18:29
Checking previous status != 'In Review' and then switched to 'In Review' - field expression now allowed for generic SObject line 33
public class ServiceRequestTrigger {
private final Map<Id, Service_Request__c> oldMap;
private final Map<Id, Service_Request__c> newMap;
private final List<Service_Request__c> newObjs;
private final Boolean isInsert;
private final Boolean isUpdate;
private final Boolean isDelete;
private final Boolean isBulk;
/**
public class ManageLeadTerritoryController {
@TestVisible private static String SCHEDULED_JOB_NAME = 'Mass Update Leads';
@RemoteAction
public static void massUpdateNow()
{
List<Territory_Setup__c> LeadTerrSetups = [select Id, Next_Mass_Update_Date_Lead__c, Status__c from Territory_Setup__c
order by lastmodifieddate desc limit 1];
if(LeadTerrSetups.size() > 0 && LeadTerrSetups[0].STatus__c == 'on')