Activity Forums Salesforce® Discussions What is the use of @AuraEnabled in Salesforce? Explain with example.

  • Deepak

    Member
    August 9, 2019 at 4:58 am

    The @AuraEnabled annotation enables client- and server-side access to an Apex controller method. Providing this annotation makes your methods available to your Lightning components (both Lightning web components and Aura components). Only methods with this annotation are exposed.

    In API version 44.0 and later, you can improve runtime performance by caching method results on the client by using the annotation @AuraEnabled(cacheable=true). You can cache method results only for methods that retrieve data but do not modify it. Using this annotation eliminates the need to call setStorable() in JavaScript code on every action that calls the Apex method.

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos