Why We Use @Auraenabled?

Why We Use @Auraenabled?

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.

Why we use cacheable true in Salesforce?

To set cacheable=true , a method must only get data, it can't mutate (change) data. Marking a method as cacheable improves your component's performance by quickly showing cached data from client-side storage without waiting for a server trip.

What is @AuraEnabled cacheable true in Salesforce?

#@AuraEnabled annotation** enables client- and server-side access to an Apex controller method. -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).

Elena Rostova
Author

Elena Rostova

Elena Rostova holds a Master's degree in Public Health Journalism. She covers groundbreaking medical research, holistic wellness trends, mental health awareness, and nutritional science.