Created
December 15, 2012 02:01
-
-
Save mailtoharshit/4290536 to your computer and use it in GitHub Desktop.
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 OpportunityTrigger on Opportunity (before Update, after Update) | |
{ | |
//Poor Design | |
for (Account acc : Trigger.New) | |
{ | |
//Creating instance of class for each trigger call | |
OpportunityRecordType art = new OpportunityRecordType() | |
...... | |
} | |
} | |
public class OpportunityRecordType() | |
{ | |
//public property | |
public String id {get; private set;} | |
//public constructor | |
id = Opportunity.sObjectType.getDescribe().getRecordTypeInforByName().get('Opp').getRecordTypeId(); | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment