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

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.

Replay

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

Category: apex Time: 2013-04-03 Views: 0
Tags: class apex

Related post

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development

search

Front-end development

Database

development tools

Open Platform

Javascript development

.NET development

cloud computing

server

Copyright (C) avrocks.com, All Rights Reserved.

processed in 0.414 (s). 12 q(s)