You need to sign in to do that
Don't have an account?
Trigger is creating 2 opportunities on Lead Conversion if the Do not create opportunity is checked
trigger opptyCreationonConvert on Lead (after update) {
List<Opportunity> o= new List<Opportunity>();
for (Lead convertedLead : Trigger.new) {
if (convertedLead.IsConverted && convertedLead.ConvertedOpportunityId==null) {
o.add (new Opportunity(
Name = convertedLead.Company,
CloseDate = date.today()+90,
AccountId = convertedLead.ConvertedAccountId,
StageName = '1 - Qualification'));
} }
if (!o.isEmpty()) {
insert o;
} }
There is no reason this trigger is creating two opportunities . Please verify
1)do you have nay other trigger on Lead which also creates a opportunity ?
2)You have any trigger on opportunity insert which updated Lead? Pleaselet me know if you have any trigger on opportunity insert.
These can be the reason
no other trigger on opportunity is creating new record.
when I am converting Lead if the Check box "Do not create Opportunity on convert" is checked then