You need to sign in to do that
Don't have an account?
dcgb2332
Apex Trigger Help!
I have a code currently in place: 1
2
3
4
5
6
7
Trigger AE_Opps_c ON Opportunity (After Insert, Before Update){
List<Opportunity> oppList = [SELECT Id, Name FROM Opportunity];
List<AE_Opps__c> aeList = new List<AE_Opps__c>();
insert aeList;
}
The purpose is to create a new list by pulling NEW opportunities and placing them in the list. There a two problems:
1) Every time a new opportunity is created, the existing opportunities are duplicated on the list
2) The Opportunity owner name is defaulting to my name and/or the other ADMIN.
Can someone please help me?
2
3
4
5
6
7
Trigger AE_Opps_c ON Opportunity (After Insert, Before Update){
List<Opportunity> oppList = [SELECT Id, Name FROM Opportunity];
List<AE_Opps__c> aeList = new List<AE_Opps__c>();
insert aeList;
}
The purpose is to create a new list by pulling NEW opportunities and placing them in the list. There a two problems:
1) Every time a new opportunity is created, the existing opportunities are duplicated on the list
2) The Opportunity owner name is defaulting to my name and/or the other ADMIN.
Can someone please help me?
Hi Raj,
Thank you for the code.
I've input the code but it's still pulling the same opportunities again, creating duplicates, and assigning me as the Opp owner..
Please try the below code.
Best Regards,
Navin S