Skip to main content
Anant Pandey (HCLTech) a posé une question dans #Apex
Please suggest me Test Class for below Trigger

 

trigger ContactToOpportunity on Contact (After insert) {

List <Opportunity> Opps = new list<Opportunity>();

for (Contact c: trigger.new ){

Opportunity o = new Opportunity (Name = c.FirstName,

CloseDate = system.today().addmonths(1),

StageName = 'Prospecting'

);

Opps.add(o);

}

Insert Opps;

}

 
2 réponses
  1. 28 mars 2019, 18:34
    @Anant - Please mark as the best answer if it helps. Thanks!