Posts

Showing posts with the label Best Practices

Lightning Components Performance Best Practices

Optimizing the performance of Lightning components is crucial for delivering fast and responsive user experiences in Salesforce applications.  Here are some best practices to improve the performance of Lightning components: Use minified versions of libraries and style sheets Use a content delivery network (CDN) Enable browser caching Use smaller image files CDN and Browser Caching wherever possible is a given.  Cloudflare CDN was used. Akamai is another common option. this is a must-have Custom Fonts (TTF files) were used from Google in the site implementation which was surprisingly taking a long time for browsers to download and use. So we moved to standard fonts which increased the score significantly. If you absolutely need to use Custom Fonts, then there are options in the community to preload this custom font as a static resource which loads faster compared to the Google Reference\ The CSS file was heavily optimized and instead of using images, we used CSS styles for some...

Sandbox Management Best Practices

Sandbox Management and Best Practices An overview of different types of sandboxes, top use cases for each type, and what is included with each when the sandbox is created or refreshed. There are 4 types of sandboxes and some are only included in certain Salesforce Editions or purchased for an additional cost, please contact your Salesforce Account Executive for details. Common use cases for each type of sandbox and recommended best practices Developer - may be refreshed every day, does not include any data automatically but allows 200 MB of data to be imported or created. The most agile and plentiful sandbox type for proof of concept, metadata-specific development, or just playgrounds for Developers and Admins to run through potential setup changes to review impact. Developer Pro - may be refreshed every day, does not include any data automatically but allows 1GB of data to be imported or created. Same idea as the Developer but with a higher storage limit for the purpose of creating or...

Salesforce Sandboxes

Image
Sandboxes create copies of your Salesforce org in separate environments. Use them for development, testing, and training, without compromising the data and applications in your production org.  Sandboxes: Staging Environments for Customizing and Testing Sandboxes are isolated from your production org, so operations that you perform in your sandboxes don’t affect your production org. Sandbox Types Developer Sandbox – A Developer sandbox is intended for development and testing in an isolated environment. A Developer Sandbox includes a copy of your production org’s configuration (metadata). Developer Pro Sandbox – A Developer Pro sandbox is intended for development and testing in an isolated environment and can host larger data sets than a Developer sandbox. A Developer Pro sandbox includes a copy of your production org’s configuration (metadata). Use a Developer Pro sandbox to handle more development and quality assurance tasks and for integration testing or user training. Partial ...

Salesforce Security Best Practises

Recommended Security Best Practices Implementing security best practices in Salesforce is crucial to protect sensitive data, maintain compliance with regulations, and safeguard your organization's reputation. Salesforce Security Multi-factor authentication (MFA) MFA is a secure method of authentication where users must provide multiple pieces of evidence to log in. It can include a combination of username/password, security keys, or authentication apps. These apps generate unique codes for added security. Mobile devices can also use biometric authentication like fingerprint scans or facial recognition. Implement precise access control using profiles and permission sets Using profiles and permission sets in Salesforce is essential for implementing security controls to ensure that users have appropriate access to data and functionality within the system. Profiles: Control access to objects by assigning appropriate object-level permissions to profiles. You can specify whether users ca...

Best practices for writing test classes in Salesforce

Writing effective test classes is crucial in Salesforce development to ensure the quality and stability of your code. Cover as many lines of code as possible. Testing Best Practices Code Coverage Best Practices Here are some best practices for writing test classes in Salesforce: Test Coverage: Aim for high code coverage, typically aiming for at least 75% coverage for your Apex classes, and 100% if possible. Ensure that your test methods exercise all code paths, including positive and negative scenarios. Isolation : Write tests that are isolated from each other and from the data in the organization. Use the @testSetup annotation to create test data once and reuse it across test methods, minimizing the need to insert duplicate data in each test method. Data Creation : Create the necessary test data within your test class using Apex code rather than relying on existing data in the organization. This ensures that your tests are self-contained and portable, independent of changes in th...

Visualforce Best Practices

Visualforce is a powerful framework for building user interfaces in Salesforce applications. Here are some best practices to keep in mind when working with Visualforce: Best Practices for Improving Visualforce Performance Best Practices for Accessing Component IDs Best Practices for Static Resources Best Practices for Controllers and Controller Extensions Best Practices for Using Component Facets Best Practices for Page Block Components Best Practices for Rendering PDF Files Rendering a Visualforce page as a PDF file is a great way to share information about your Salesforce organization. Here are some best practices for you to consider. Best Practices for <apex:panelbar> Documentation Typographical Conventions