Advertisement
Guest User

Untitled

a guest
Oct 2nd, 2014
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. trigger OpportunityTrigger on Opportunity (after insert) {
  2.  
  3. for (Opportunity opp :trigger.new)
  4. {
  5. if (opp.RecordTypeId == '012g00000000PxA' && opp.Amount >= 100000)
  6. {
  7. opp.Big_Value_Opportunity__c = true;
  8. opp.OwnerId = assignOwner(opp.AccountId);
  9. }
  10. }
  11.  
  12. public Id assignOwner(Id accountId)
  13. {
  14. return [SELECT OwnerId FROM Account WHERE Id = :accountId][0].Id;
  15. }
  16.  
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement