Activity Forums Salesforce® Discussions What is the best practice you are using while coding in Salesforce?

  • Anjali

    Member
    August 19, 2020 at 7:55 am
    • Bulkify your code: Bulkifying Apex code refers to the concept of making sure the code properly handles more than one record at a time. When we try to load the link of the records using the Data Loaders, then we make sure that code will satisfy.
    • Avoid SOQL Queries inside For loops: When queries are placed inside a for loop, a query is executed on each interaction and the governor limit is easily reached. Instead move the SOQL query outside of the for loop and retrieve all the necessary data in a single query.
    • Avoid Multiple Triggers on the Same Object: Write the Single Trigger on the each object and write the logic in the classes and call that classes in the triggers.
    • use of the Limits Apex Methods to avoid Hitting Governor Limits.
    • Avoid hardcoding IDs.

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos