Skip to main content
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 个回答
  1. 2019年3月28日 18:34
    @Anant - Please mark as the best answer if it helps. Thanks!