Activity Forums Salesforce® Discussions What are the different annotations in Salesforce?

  • Shweta

    Member
    April 15, 2020 at 11:06 am

    Annotations are defined with an initial @ symbol.
    Apex supports the following annotations:
    1. @AuraEnabled: It enables client- and server-side access to an apex controller method.
    2. @deprecated: It is used to identify methods, classes, exceptions, enums, interfaces, or variables that can no longer be referenced in subsequent releases of the managed package in which they reside.
    3. @ Future: It is used to identify methods that are executed asynchronously.
    4. @ isTest: It is used to define classes and methods that only contain code used for testing.
    5. @RemoteAction: This annotation provides support for Apex methods used in Visualforce to be called via JavaScript.
    6. @ReadOnly: It allows you to perform unrestricted queries against the Lightning Platform database.

  • Anuj

    Member
    April 15, 2020 at 1:27 pm

    1. An apex annotation modifies the way a method or class is used similar to annotations in Java.
    2. Annotations are defined with an initial @ symbol, followed by the appropriate keyword.
    3. To add an annotation to a method, specify it immediately before the method or class definition.
    EX:-
    Public class classname @ future
    Public static void methodname (String Name)
    Apex supports the following annotations.
    @ Deprecated
    @ Future
    @ Is test
    @ Read-only
    @ Remote action

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos

Free 5 Day Salesforce Challenge!

Video in

To access the signup form head over to www.talentstacker.com/Salesforce TalentStacker Podcast Salesforce Episode: https://talentstacker.libsyn.com/how-to-earn-60k-100k-a-year-within-6-months-without-a-college-degree-say-what-salesforce-career-development-path-with-bradley-rice Do you already have a job as a Salesforce Professional and…