Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- trigger OpportunityTrigger on Opportunity (after insert) {
- for (Opportunity opp :trigger.new)
- {
- if (opp.RecordTypeId == '012g00000000PxA' && opp.Amount >= 100000)
- {
- opp.Big_Value_Opportunity__c = true;
- opp.OwnerId = assignOwner(opp.AccountId);
- }
- }
- public Id assignOwner(Id accountId)
- {
- return [SELECT OwnerId FROM Account WHERE Id = :accountId][0].Id;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement