How to write Unit Tests with Service Locator

Step-by-step example how to write Salesforce Apex unit tests using the Service Locator pattern. The service locator pattern is a design pattern used in software development to encapsulate the processes involved in obtaining a service with a strong abstraction layer. We already mention it in our article: How to develop a flexible Apex code for Salesforce.

How to increase code coverage quickly in Salesforce

One of the requirements from Salesforce to deploy Apex code to the production environment or upload package to the Salesforce AppExchange related with Ape[ code coverage. Unit tests must cover at least 75% of your Apex code, and those tests must pass. Code coverage indicates how many executable lines of code in your classes and […]

How to develop flexible Apex code for Salesforce

Day-to-day developer work related not only with writing new functionality but updating existing ones. When a developer tasked with adding a new feature to an existing application, the goal is to extend the functionality of that application with new behaviors. Extending software is the introduction of a new behavior by the addition of code. Some applications are flexible to […]

How to send Custom Desktop/Push Notifications in Salesforce

Everyone knows that it is so important to send notifications when important events occur. For example, alert an account owner if a new support case is logged while trying to close a deal. Or, send a notification for a unique workflow built entirely with custom objects. Previously, you could send only standard notifications for use […]

How to fix the caching problem in Salesforce Lighting Component

Salesforce trying to optimize performance by caching components on the client-side. This is awesome for the end-users because page loads will faster. This is a lot less awesome for developers when developing lightning components because they may think that the code is wrong. Often they have to hit hard refresh a few times while you […]

How to Increase Salesforce Governor Limits

Salesforce is known as CRM with a lot of Limits. Because Salesforce Apex runs in a multitenant environment, the Apex runtime engine strictly enforces limits so that runaway Apex code or processes don’t monopolize shared resources. If some Apex code exceeds a limit, the associated governor issues a runtime exception that cannot be handled.

How to build Custom Flexible Rest Architecture in the Salesforce

The Classic Salesforce platform is designed to use the MVC pattern for developing applications and customizing existing functionality. The benefits of server rendering are obvious, but we often need more dynamic in the application. In this case, Rest Services will help us.

How to fix ‘Bad value for restricted picklist field’ error

Users or developers may receive the following error when they attempt to create or update a record in Salesforce: Error: Invalid Data. Review all error messages below to correct your data.‘Bad value for restricted picklist field: PicklistValue’ This error occurs when the picklist field referenced in the error message meets each of the following conditions: