You need to sign in to do that
Don't have an account?

how to post querries
Hey, In Apex Trigger i have 2 big problems one is method does not exist and last one variable does not exist these shown in Problem tab and that type of issue i saw in every TriggerHandlerClass. So below i mentioned my code.
public class Account2TriggerHandler {
public static void createRelatedOpp(List<Account> newList){
List<Opportunity> oppoToBeInserted = new List<Opportunity>();
for(Account acc : newList){
Opportunity opp = new Opportunity();
opp.Name = acc.Name;
opp.AccountId = Acc.Id;
opp.StageName = 'Prospecting';
opp.CloseDate = System.today();
oppToBeInserted.add(opp);
}
if(!oppToBeInserted.isEmpty()){
insert oppToBeInserted;
}
}
public class Account2TriggerHandler {
public static void createRelatedOpp(List<Account> newList){
List<Opportunity> oppoToBeInserted = new List<Opportunity>();
for(Account acc : newList){
Opportunity opp = new Opportunity();
opp.Name = acc.Name;
opp.AccountId = Acc.Id;
opp.StageName = 'Prospecting';
opp.CloseDate = System.today();
oppToBeInserted.add(opp);
}
if(!oppToBeInserted.isEmpty()){
insert oppToBeInserted;
}
}
Can you also post the trigger as comment below so we can check what exactly the issue and modify the code accordingly.
Thanks,
Please use below code:-
if you need any assistanse, Please let me know!!
Kindly mark my solution as the best answer if it helps you.
Thanks
Mukesh
Kindly mark my solution as the best answer if it helps you.
Thanks
Mukesh