当我尝试将自定义对象插入现有的潜在客户对象时,我收到一条错误消息。
List<Lead> leads =[select Id from Lead where Email =:lead.Email ];
if(leads.size()>0)
{
Lead existing_lead = new Lead(Id = leads[0].id);
social_account.Lead__c = existing_lead.Id; //social_account is a custom object that
//has a child relationship to lead.
//ie lead is a parent of social_accounts.
update existing_lead;
insert social_account; //if there is an existing lead with same same email,
//i'd like to insert new social_account to an exsiting lead.
}
我收到此错误:
554 System.DmlException:更新失败。第 0 行的第一个异常,ID 为 00Q3000000WW3isEAD;第一个错误:CANNOT_UPDATE_CONVERTED_LEAD,无法引用转换后的潜在客户:[]
Class.ProcessContact.handleInboundEmail:第 81 行,第 9 列外部入口点
即使我注释掉“更新existing_lead”,我也会收到类似的错误消息。
554 System.DmlException:插入失败。第 0 行的第一个异常;第一个错误:CANNOT_UPDATE_CONVERTED_LEAD,无法引用转换的潜在客户:[Lead__c]
Class.ProcessContact.handleInboundEmail:第 82 行,第 9 列外部入口点
我将不胜感激任何建议。
问候