Salesforce Developer Interview questions LWC Can we call the @AuraEnabled function in the apex class using wire ? Ans : Function also needs to have cacheable = true annotation ie should be like @AuraEnabled(cacheable = true) What do you mean by cacheable = true annotations ? Ans : First of all when you mark function as cacheable = true it can only retrieve data i.e. it cant have any DML. I t is used to improve component performance by quickly showing cached data from client side storage without waiting for server trip . Remember to refresh the stale data provisioned by Apex we have to use refreshApex as LDS doesn’t manage data coming from Apex ( In case of wired service) Why do we use $ when passing property in wire function, what does it mean? [Latest Salesforce lightning interview questions and answeres] Ans: $ prefix tells the wire service to treat values passed as a property of the class and evaluate it as this.propertyName and the...
Posts
Showing posts from June, 2023