function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
pranab khatuapranab khatua 

Error: AddNoteLeadController Compile Error: Incompatible types since an instance of SObject is never an instance of Lead at line 6

public class AddNoteLeadController {

    Public Lead ld{get;set;}
    public AddNoteLeadController(ApexPages.StandardController controller) {
     
        ld = (Lead)controller.getRecord();   
    }

}


<apex:page standardController="Lead" extensions="AddNoteLeadController">
    
    <apex:form >
        
    </apex:form>
    
</apex:page>

Please help and tell me how will I get the standard lead object?
 
Amit Chaudhary 8Amit Chaudhary 8
Please check below post. I hope that will help you
https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_controller_extension.htm

Please let us know if this will help you
sachin kadian 5sachin kadian 5
Hi Pranab,

your code looks totally correct and working for me . I think you can refresh you developer console or refresh from server if you are using eclipse once and try to save it again.