+ Start a Discussion
Aryan JhaAryan Jha 

Method does not exist or incorrect signature: void triggeronoppandcontact(List<Opportunity>) from the type oppsoftrigger at line 2 column 15

public class oppsoftrigger1
{
public static void triggeronoppsandcontact(List<Opportunity>opp)
{
List<Contact>conlist=new List<Contact>();
List<Opportunity>oppslist=new List<Opportunity>([SELECT Id,Name,CloseDate FROM Opportunity WHERE CloseDate=TODAY AND Id IN:Trigger.new]);
for(Opportunity o:opp)
{
Contact c=new Contact();
c.FirstName='neha';
c.LastName='mehra';
c.AccountId=o.AccountId;
conlist.add(c);
}
insert conlist;
}
}
Then i make a trigger on opportunity
trigger oppsontrigger on Opportunity (after insert) {
oppsoftrigger.triggeronoppandcontact(Trigger.new);
}
AnudeepAnudeep (Salesforce Developers) 
should it be oppsoftrigger1.triggeronoppandcontact(Trigger.new); ? Please verify the classname
Aryan JhaAryan Jha
Thanks for the response it help me to solve my query
AnudeepAnudeep (Salesforce Developers) 
Hi Aryan - You are welcome. Please mark the answer as Best so that it can help others in the community and to also close-loop this post