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
michelle emanuel 59michelle emanuel 59 

using apex in components

Cannot use "Controller" in apex class name.

Trailhead requests that the apex class name be DisplayCaseController but componet cannot be saved when "Controller" is in class name. If I shorten the name to DisplayCaseCont it will save but not as DisplayCaseController. However the trailhead check required the name to be DisplayCaseController to pass.
<aura:component controller="DisplayCaseController" >
    <aura:attribute name="record" type="Case"/>
    <p>{!v.record.Subject}</p>
    <p>{!v.record.Description}</p>
    <p>{!v.record.Status}</p>
</aura:component>

 
Martijn SchwarzerMartijn Schwarzer
Hi Michelle,

I always use "Controller" in apex class names (for controllers), so that should work. 

Do you by any chance already have a class called DisplayCaseController in your org? Maybe you just need to adjust that class to meet the Trailhead requirements.

The only other explanation I see is that there is something wrong in your org. Either contact support to have it fixed, or just sign up for a new Deve Org for this Trailhed challenge.

Good luck and happy coding!

Best regards,
Martijn Schwärzer