Test Code:Error: Compile Error: Invalid type: CustomLead_c at line 9 column 14

April 3   apex 0 0 Views
Advertisement

I am receiving "Error: Compile Error:Invalid typr; CustomLead_c at line 9 column 14". Can any pls tell me how to fix this error.

*Code:*

public class LeadConversion {

public PageReference RedirecttoLead() {     String currentLead = '/' + leadObj.Id;     PageReference pageRef = new PageReference(currentLead);     return pageRef; }   private CustomLead_c leadObj;  // The extension constructor initializes the private member // variable acct by using the getRecord method from the standard // controller. public LeadConversion(ApexPages.StandardController stdController) {     leadObj = (CustomLead_c)stdController.getRecord(); }  public void convertLead(){      Account acc = new Account();     //acc.Name = leadObj.Name;     //acc.BillingAddress = leadObj.Address;    try     {      insert acc;     }     Catch (Exception ex1)     {       ex1.getmessage();     }     Contact cc = new Contact();     //cc.Name = leadObj.Name;     //cc.BillingAddress = leadObj.Address;     try     {      insert cc;     }     Catch (Exception ex2)     {       ex2.getmessage();     }      Opportunity opp = new Opportunity();     //opp.Name = leadObj.Name;     //opp.BillingAddress = leadObj.Address;      try     {      insert opp;     }     Catch (Exception ex3)     {       ex3.getmessage();     }  }  } 

Thanks, Regards, Lavanya.

Advertisement

Replay

You have used CustomLead_c instead of CustomLead__c in your code.
API names of custom objects end with __c.

Tags: class, apex
PC site About | Contact

©2016 avrocks.com all rights reserved

processed in 0.124 (s). 5 q(s)