This file contains 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
/** | |
* Step 1: | |
* TriggerHandler | |
* This class is the primary class to centralize all Trigger logic | |
* This class is the virtual class, that you must extend for each of the class where you implement actual trigger logic | |
* public class ContactTriggerHandler extends TriggerHandler{ | |
* } | |
* This class provides default and empty implementation for each of the trigger event, and processTrigger() method | |
which will call actual Trigger event methods that is developed in Handler class like ContactTriggerHandler | |
* Created by: contact (at) dhruvsoft.com |
This file contains 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
trigger ContactsOnAccount on Contact (after insert, after delete,after undelete,after update) { | |
Set<Id> aId = new Set<Id>(); | |
if(Trigger.isInsert || Trigger.isUndelete){ | |
for(Contact opp : Trigger.New){ | |
aId.add(opp.AccountId); | |
} | |
List<Account> acc = [select id,No_of_Contacts_in_SFDC__c from Account where Id in:aId]; | |
List<Contact> con = [select id from contact where AccountId in :aId]; | |
This file contains 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
IMAGE ( IF ( AND ( DeliveryDate__c >=56 , ISPICKVAL( Stage__c, "New Order" )),"/img/samples/color_green.gif", | |
IF ( ISPICKVAL( Stage__c, "New Order" ),"/img/samples/color_red.gif", | |
IF ( AND ( DeliveryDate__c >= 56 , ISPICKVAL( Stage__c, "In production" )),"/img/samples/color_green.gif", | |
IF ( AND ( DeliveryDate__c < 56 , DeliveryDate__c >= 42 , ISPICKVAL( Stage__c, "In production" )),"/img/samples/color_yellow.gif", | |
IF ( ISPICKVAL( Stage__c, "In production" ),"/img/samples/color_red.gif", | |
IF ( AND ( DeliveryDate__c >= 7 , DeliveryDate__c < 14 , FactoryShipmentDate__c > 35 , ISPICKVAL( Stage__c, "Transported" )),"/img/samples/color_green.gif", | |
IF ( AND ( DeliveryDate__c >= 14 , DeliveryDate__c < 21 , FactoryShipmentDate__c > 28 , ISPICKVAL( Stage__c, "Transported" )),"/img/samples/color_green.gif", | |
IF ( AND ( DeliveryDate__c >= 21 , DeliveryDate__c < 28 , FactoryShipmentDate__c > 21 , ISPICKVAL( Stage__c, "Transported" )),"/img/samples/color_green.gif", | |
IF ( AND ( DeliveryDate__c >= 28, DeliveryDate__c < 35 ,Fac |