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
krupananda reddykrupananda reddy 

Failed to save undefined: No CONTROLLER named DisplayCaseController found

When i created a lightning component and its related server side controller, i got the below error. There exists a server side controller with the name. And "ExpRep_lightnin" is my organization name space.
Failed to save undefined: No CONTROLLER named apex://ExpRep_lightnin.DisplayCaseController found: Source
Mohith Kumar ShrivastavaMohith Kumar Shrivastava
Hi ,

Can you please post the whole code for me to look at your issue ?Thanks
krupananda reddykrupananda reddy
I have apex controller as per the challenge, 
public class DisplayCaseController {

    @AuraEnabled
    public static Case getCaseFromId(Id caseID) {
        if(caseID == null) {
            return [SELECT ID, Subject, Description, STATUS from Case LIMIT 1];
        }
        
        List<Case> cases = [ SELECT Id, Subject, Description, Status from CASE where ID = :caseID ];
        
        if(cases.size() == 0) {
            return [SELECT ID, Subject, Description, STATUS from Case LIMIT 1];
        } else {
            return cases[0];
        }        
    }
    
}

But when i save the component which uses the above controller, i am getting an error like "Failed to save undefined: No CONTROLLER named apex://ExpRep_lightnin.DisplayCaseController found: Source".
<aura:component controller="DisplayCaseController">
    <aura:attribute name="record" type="Case"/>
    <aura:attribute name="caseId" type="String" default="500F000000XgaGj"/>
    <br/>
    <ui:inputText label="Case Id: " value="{!v.caseId}"/>
    <ui:button label="Get Case" press="{!c.getCase}" />
    <br/>
    <ui:outputText value="{!v.record.Subject}"/>
    <br/>
    <ui:outputTextArea value="{!v.record.Description}"/>
    <br/>
    <ui:outputText value="{!v.record.Status}"/>
    <br/>
</aura:component>

I am suspecting is there any issue with the org having NameSpace defined for it ?


 
Raghavendra Masineni.Raghavendra Masineni.
Please change the name of the controller class to DisplayCaseController1 Or any thing other than DisplayCaseController. Looks like this name is used by Salesforce classes.