Posts

Showing posts with the label Annotations in Apex in Salesforce.com

Annotations in Apex in Salesforce.com

Annotations in Apex in Salesforce.com An Apex annotation modifies the way a method or class is used, similar to annotations in Java. Annotations are defined with an initial @ symbol, followed by the appropriate keyword. To add an annotation to a method, specify it immediately before the method or class definition. Apex supports the following annotations: 1. @Deprecated 2. @Future 3. @IsTest 4. @ReadOnly 5. @RemoteAction 6. @TestVisible Apex REST annotations: 1. @RestResource(urlMapping='/yourUrl') 2. @HttpDelete 3. @HttpGet 4. @HttpPatch 5. @HttpPost 6. @HttpPut @future annotation in Salesforce:    Use the future annotation to identify methods that are executed asynchronously. When you specify future, the method executes when Salesforce has available resources.    For example, you can use the future annotation when making an asynchronous Web service callout to an external service. Without the annotation, the We...