CANNOT_UPDATE_CONVERTED_LEAD,无法引用转换后的潜在客户:[Lead__c]

Nao*_*ino 3 foreign-keys salesforce foreign-key-relationship apex-code

当我尝试将自定义对象放入现有的主角对象时,我收到一条错误消息.

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.
}
Run Code Online (Sandbox Code Playgroud)

我收到此错误:


554 System.DmlException:更新失败.第0行的第一个例外,ID为00Q3000000WW3isEAD; 第一个错误:CANNOT_UPDATE_CONVERTED_LEAD,无法引用转换后的引导:[]

Class.ProcessContact.handleInboundEmail:第81行,第9列外部入口点


即使我注释掉'update existing_lead',我也会收到类似的错误消息.


554 System.DmlException:插入失败.第0行的第一个例外; 第一个错误:CANNOT_UPDATE_CONVERTED_LEAD,无法引用转换后的引线:[Lead__c]

Class.ProcessContact.handleInboundEmail:第82行,第9列外部入口点


我将不胜感激任何建议.

问候

Ada*_*ler 15

此错误表示潜在客户记录已转换为联系人.转换后,无法更新潜在客户记录.Lead对象具有IsConverted属性,您可以检查它是否已转换.如果IsConverted为true,则ConvertedContactId将保留新联系人记录的联系人ID.

Lead Object参考