Tuesday, 6 August 2024

Annotations in Apex

 𝗔𝗻𝗻𝗼𝘁𝗮𝘁𝗶𝗼𝗻𝘀 𝗮𝗻𝗱 𝗧𝗵𝗲𝗶𝗿 𝗨𝘀𝗲𝘀

1. @𝗔𝘂𝗿𝗮𝗘𝗻𝗮𝗯𝗹𝗲𝗱: Exposes methods to Lightning components for client-side calls.

2. @𝗗𝗲𝗽𝗿𝗲𝗰𝗮𝘁𝗲𝗱: Marks methods/classes as outdated for future removal.

3. @𝗙𝘂𝘁𝘂𝗿𝗲: Runs methods asynchronously, ideal for callouts.

4. @𝗜𝗻𝘃𝗼𝗰𝗮𝗯𝗹𝗲𝗠𝗲𝘁𝗵𝗼𝗱: Allows methods to be called from Flows.

5. @𝗜𝗻𝘃𝗼𝗰𝗮𝗯𝗹𝗲𝗩𝗮𝗿𝗶𝗮𝗯𝗹𝗲: Exposes variables in methods for Flow integration.

6. @𝗜𝘀𝗧𝗲𝘀𝘁: Marks classes/methods for unit testing.

7. @𝗧𝗲𝘀𝘁𝗦𝗲𝘁𝘂𝗽: Prepares test data for use across tests.

8. @𝗧𝗲𝘀𝘁𝗩𝗶𝘀𝗶𝗯𝗹𝗲: Makes private members accessible in tests.

9. @𝗝𝘀𝗼𝗻𝗔𝗰𝗰𝗲𝘀𝘀: Controls JSON serialization/deserialization.

10. @𝗡𝗮𝗺𝗲𝘀𝗽𝗮𝗰𝗲𝗔𝗰𝗰𝗲𝘀𝘀𝗶𝗯𝗹𝗲: Shares code across namespaces.

11. @𝗥𝗲𝗮𝗱𝗢𝗻𝗹𝘆: Retrieves up to 1,000,000 rows; no DML allowed.

12. @𝗥𝗲𝗺𝗼𝘁𝗲𝗔𝗰𝘁𝗶𝗼𝗻: Exposes methods to JavaScript in Visualforce.

13. @𝗦𝘂𝗽𝗽𝗿𝗲𝘀𝘀𝗪𝗮𝗿𝗻𝗶𝗻𝗴𝘀: Suppresses warnings to clean up console messages.

No comments:

Post a Comment