Category: Enhancement

Winter ’21 Apex New Feature

 This post will cover some of my favorite Apex new features from Winter ’21. I have published another post that covered new existing enhancements for Flow Designer. To explore all the new features from Winter ’21 release, I highly recommend -Sign up to a pre-release org and explore all the new features.Post your findings in the Trailblazer Community and include the hashtag #Winter21Treasure to receive Trailhead Treasure Hunter badgeHere is the listSafe Navigation OperatorWith the introduction of Safe Navigation operator (?.), we are no more needed to perform an explicit null check to avoid NullPointer Exception. Basically, if the left side expression of the operator evaluates to null, then the right side will not be evaluated. //Before Winter’21List<Contact> allContacts = [ SELECT Id FROM Contact WHERE name = :contactName];if (allContacts.size() > 0) { String Id = allContacts.get(0).Id;}//After Winter’21String Id = [SELECT Id FROM Contact WHERE name = :contactName]?.get(0).Id;Update Resources with the PATCH HTTP Method in Apex CalloutsBefore Winter ’21 it was not possible to make a PATCH request from Salesforce. We always used the hack of using the PUT method to make it work. But with Winter ’21 we can now make PATCH metho in our HttpRequest class.Detect Apex Runtime Context with RequestId and QuiddityNow it is possible to detect Apex context at runtime and correlate multiple logs triggered by the request, using Request ID and Quiddity values.//Get info about...

Read More

Winter ’21 Flow Enhancements

 Winter ’21 pre-release org is ready. And without any surprise, Winter ’21 is also bringing lots of great enhancements. In this post, I am going to focus on a few Flow Enhancements that we will be getting soon and will be able to take advantage of. Handling Deletion Through Record Triggered FlowWith Winter ’21, we will be able to trigger a flow when the record is getting deleted. This is similar to Delete context from Trigger. To me, this is a great enhancement. Few things to note, you can. only do Before the record is deleted, not after the record is deleted. And if the deleted record is recovered later, that will not rollback any changes/actions performed as part of the flow. To handle that situation, the recommended approach is to write Apex after undelete trigger.Auto LayoutsWith this release, you will be presented with the option of selecting either a Freeform or Autolayout option. Autolayout is in Beta stage right now. But if you select Autolayout, you basically keep adding components by clicking on + sign. No need to organize and dragging here and there to make the flow look good, keep the connector line straight, etc. If you are like me, who likes to see things organized, I am sure you will like this feature as well.Debug Flow as Specific UserIf you feel frustrated with the complaint that flow...

Read More
Loading