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
UriMUriM 

Don't understand the error message

Hi All,

 

I have a custom object and I try to create the following class but I cannot understand the error message, please help.

 

The custom object is called Qualification and the Lead record has a lookup field Qualification pointing to the Qualicaition record. The key of the Qualificaiton record is Name

 

 public with sharing class Controller_Qualification {

    public ApexPages.StandardController standardLeadController;
    
    public ApexPages.StandardController myQualificationController {get; set;}
    public Qualification qualification {get; set;}

    public Controller_Qualification(ApexPages.StandardControll?er cntrl) {
        
        standardLeadController = cntrl;
                
        Lead lead = (Lead)cntrl.getRecord();
        String qualificationName = lead.Qualificaiton;
        qualification = cache.load (Qualification.SObjectType, qualificationName);

        myQualificationController = new ApexPages.StandardController (qualification);
    }
}

 

Thanks,

Uri

Mukul MudgalMukul Mudgal

What is the error message, you didn't mention that.

Also in your code, when you use custom object then you should use the API name not  the label.

 

So, whereever you are using custom object Qualification, replace it with Qualification__c

Uri MargalitUri Margalit

Hi,

 

Thanks for your feedback, I finally fix it by query the fields I need

 

I also change the object name to by with the __c.