completed assignment
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
trigger CategorizedOpprtunity on Opportunity (before insert, before update) {
|
||||
for (Opportunity opp : Trigger.New)
|
||||
{
|
||||
if (opp.Amount != null)
|
||||
{
|
||||
if (opp.Amount < 10000)
|
||||
{
|
||||
opp.Category__c = 'Small';
|
||||
}
|
||||
else if (opp.Amount >= 10000 && opp.Amount < 50000)
|
||||
{
|
||||
opp.Category__c = 'Medium';
|
||||
} else if (opp.Amount >= 50000) {
|
||||
opp.Category__c = 'Large';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user