You need to sign in to do that
Don't have an account?
Simon234
Trigger LeadConvert and Opportunity Name change
Hello. I need to convert a Lead with LeadConvert and change an opp's Name like this: 'AccountName + DateTime.now'. How can I do that? This doesn't work:
for (Lead lead : Trigger.new) { if (lead.isConverted == false && lead.Status == 'Closed - Converted') { lc.setLeadId(lead.Id); lc.setConvertedStatus(convertStatus.MasterLabel); lcList.add(lc); String s = String.valueOf(lc.getAccountId()); String b = String.valueOfGmt(Datetime.now()); lc.setOpportunityName(s + b); List<Database.LeadConvertResult> lcrList = Database.convertLead(lcList,false); }I become 'null+DateTime.now'. How can I take AccName before Database.convertLead? :(
https://help.salesforce.com/articleView?id=000220247&type=1
https://help.salesforce.com/articleView?id=000220247&type=1