How to select the Salesforce release for a Scratch Org
Matheus Goncalves
by Matheus Goncalves
4y ago
Did you know you can specify the release (preview or previous) when creating a scratch org? That is especially helpful when testing your code against future features in Preview orgs, but it’s even more than that: During every major Salesforce release, you have the opportunity to get early access to the release in your scratch orgs and sandboxes to test new customizations and features before your production org is upgraded. This is called the Salesforce Preview, and scratch orgs created on the upcoming release are called preview scratch orgs. This way you not only can try out new features in a ..read more
Visit website
How to Query Salesforce Code Coverage
Matheus Goncalves
by Matheus Goncalves
4y ago
In Salesforce Orgs, code coverage percentage is a calculation of the number of covered lines divided by the sum of the number of covered lines and uncovered lines. In addition to ensuring the quality of your code, unit tests enable you to meet the code coverage requirements for deploying or packaging Apex. To deploy Apex or package it for the Salesforce AppExchange, unit tests must cover at least 75% of your Apex code, and those tests must pass. After running tests, you can view code coverage information in the Tests tab of the Developer Console. The code coverage pane includes coverage inform ..read more
Visit website
Unit Test: Can we mock relationships in Apex?
Matheus Goncalves
by Matheus Goncalves
4y ago
I’ve been trying to use some of my spare time to help my fellow Salesforce Developers in our community. And one of the best places to do so, is Salesforce Stack Exchange. And a few days ago someone posted the following question: How can I write a test method without actually doing the query (to speed up test run times)? As far as I know, the only way to return relationships more than one level deep is to query for them. I know ApexMock has IDGenerator but cannot see how I can use it for this use case? Well, can we mock relationships in Apex to improve a test’s performance? And the answer is ..read more
Visit website
Curious behavior: Specialization of sObjects on Salesforce
Matheus Goncalves
by Matheus Goncalves
4y ago
As you may know at this point, I’ve been working with Salesforce Development for a while now, and the more I learn about it, the more interested I become in learning more. I see it as a healthy cycle of improvement. During this process I got amazed about how flexible sObjects are, and how they represent Salesforce records and their fields. Trailhead is our friend: Each Salesforce record is represented as an sObject before it is inserted into Salesforce. Likewise, when persisted records are retrieved from Salesforce, they’re stored in an sObject variable. Standard and custom object records in S ..read more
Visit website
How Salesforce handles Null and Empty Strings
Matheus Goncalves
by Matheus Goncalves
4y ago
This may be considered for some a basic topic when it comes to Salesforce development, but it’s very helpful to understand the differences between NULL and EMPTY strings in Salesforce. Our science teachers have taught us that the best way to learn something is by experimenting it, right? So, let’s open Force.com Developer Console and see what happens when we start playing around with some String variables. Interesting, right? Salesforce, as expected, treats Empty and Null strings differently. When concatenating a null variable, it actually converts it to a string with a value equals to ‘null ..read more
Visit website
How to write an advanced test class for an advanced trigger?
Matheus Goncalves
by Matheus Goncalves
4y ago
If you’re reading this article, I understand you have already been exposed to the basic concepts of Salesforce triggers, test classes and the best practices related to it, right? If you’re not familiar with these patterns, take a look: Triggers Don’t forget that trigger handle up to 200 records per execution. Don’t put the logic (incl. SOQL or DML) in the trigger, use a handler class. Don’t push the trigger.New logic to the handler class method, you should filter on records that are in related scope. You will increase performance, reduce governor limits consumption, and limit regression risks ..read more
Visit website
How to select the Salesforce release for a Scratch Org
Matheus Goncalves
by Matheus Goncalves
5y ago
Did you know you can specify the release (preview or previous) when creating a scratch org? That is especially helpful when testing your code against future features in Preview orgs, but it’s even more than that: During every major Salesforce release, you have the opportunity to get early access to the release in your scratch orgs and sandboxes to test new customizations and features before your production org is upgraded. This is called the Salesforce Preview, and scratch orgs created on the upcoming release are called preview scratch orgs. This way you not only can try out new features in a ..read more
Visit website

Follow Matheus Goncalves on FeedSpot

Continue with Google
Continue with Apple
OR