You need to sign in to do that
Don't have an account?
jitender.360degreec1.3890927586840896E12
Error when trying to Convert a Lead
Hi,
i write an trigger on lead for Lead Conversion based on some conditions.
In that trigger i am getting below error
Error: Invalid Data.
Review all error messages below to correct your data.
Apex trigger tg_ConvertLead caused an unexpected exception, contact your administrator: tg_ConvertLead: execution of AfterInsert caused by: System.DmlException: ConvertLead failed. First exception on row 0; first error: UNKNOWN_EXCEPTION, System.DmlException: Insert failed. First exception on row 0; first error: UNKNOWN_EXCEPTION, externalized text label not found, section: 'udd_HotOrganization' missing: [] (System Code) : []: Trigger.tg_ConvertLead: line 41, column 1
can anyone help me with the same....
thanks in advance...
i write an trigger on lead for Lead Conversion based on some conditions.
In that trigger i am getting below error
Error: Invalid Data.
Review all error messages below to correct your data.
Apex trigger tg_ConvertLead caused an unexpected exception, contact your administrator: tg_ConvertLead: execution of AfterInsert caused by: System.DmlException: ConvertLead failed. First exception on row 0; first error: UNKNOWN_EXCEPTION, System.DmlException: Insert failed. First exception on row 0; first error: UNKNOWN_EXCEPTION, externalized text label not found, section: 'udd_HotOrganization' missing: [] (System Code) : []: Trigger.tg_ConvertLead: line 41, column 1
can anyone help me with the same....
thanks in advance...
trigger tg_ConvertLead on Lead (after insert,after update) {
list<opportunity>opplist = new list<opportunity>();
List<Database.LeadConvert> leadConverts = new List<Database.LeadConvert>();
//Database.LeadConvert lc = new Database.LeadConvert();
List<LeadStatus> convertedLeadStatuses = [SELECT Id, MasterLabel FROM LeadStatus WHERE IsConverted=true LIMIT 1];
Map<Id, String> leadstatuses = new Map<Id, String>();
for(LeadStatus ls : convertedLeadStatuses)
{
leadstatuses.put(ls.Id, ls.MasterLabel);
}
for (Lead nl : Trigger.new)
{
if(nl.isConverted == false) //to prevent recursion &&(nl.Appointment__c!=null)
{
Database.LeadConvert lc = new Database.LeadConvert();
lc.setLeadId(nl.id);
// lc.setOverwriteLeadSource(false);
lc.setDoNotCreateOpportunity(false);
lc.setConvertedStatus(convertedLeadStatuses[0].MasterLabel);
// Check to see if account already exists
/* if(!peAccounts.isEmpty()){
if(peAccountsFlipped.get(nl.email)!=null){
lc.setAccountId(peAccountsFlipped.get(nl.email));
lc.setOwnerId(peAccountsOwner.get(peAccountsFlipped.get(nl.email)));
lc.setDoNotCreateOpportunity(true);
}
} else {
*/ // In the event an account doesn't exist
// lc.setOwnerId('005G000000402QS');
// lc.setOpportunityName(nl.Name);
// }
//leadConverts.add(lc);
Database.LeadConvertResult lcr = Database.convertLead(lc);
system.debug('++++++++++lcr'+lcr);
}
}
//Database.LeadConvertResult lcr = Database.convertLead(leadConverts);
//Database.convertLead(leadConverts);
/*for(Database.LeadConvertResult lcs:lcr)
{
if(lcs.issuccess())
{
opportunity opp = new opportunity();
opp.id = lcs.getopportunityid();
opp.stagename = 'Appointment Booked';
opp.CloseDate = date.today()+90;
opp.AccountId = lcs.getAccountId();
opplist.add(opp);
}
}
if(opplist.size()>0)
{
update opplist;
}*/
}