Salesforce Winter 19 updates
1. Find the Data You Need in a Jiffy with List View Search
Use the new search bar to search the field data in your list views and find the records you need in record time.
2. New attribute in lightning: accordion
Before Winter 19 release, the default behavior of the accordion was that only one section can be opened at a time. If you want to open all the sections at once, it was not supported. The workaround was to use HTML accordion instead of lightning according. But now with Winter 19, Salesforce has introduced a new attribute called allowMultipleSectionsOpen. If this attribute is set to true, then all the sections can be opened at the same time.
3. New component lightning: map
Before Winter 19 release, to display a map, you need to use an external JS library like Leaflet. But with Winter 19, maps will be supported by the platform using lightning: map. This tag is similar to the apex: map tag available on the Visualforce page.
4. Mark Apex Method as Cacheable
The current solution to implement client-side caching is to use setStorable() on every JavaScript action that calls the Apex method. With Winter 19, you can mark an apex method as Cacheable. To cache data returned from an Apex method for any component with an API version of 44.0 or higher, annotate the Apex method with @AuraEnabled(cacheable=true). For example:
To update an existing component to use an API version of 44.0, remove setStorable() calls in JavaScript code. Annotate the Apex method with @AuraEnabled(cacheable=true) instead of @AuraEnabled, or you’ll get an error response for the action.
5. Debug All Your Orgs for Free with Apex Replay Debugger (GA)
One of the coolest features, Apex Replay Debugger simulates a live debugging session using a debug log, which is a recording of all interactions in a transaction. You no longer need to parse through thousands of log lines manually. Instead, Apex Replay Debugger presents the logged information similarly to an interactive debugger, so you can debug your Apex code. With this release, we added checkpoints, which provide more information about your variables than debug logs do.
Apex Replay Debugger is generally available when Salesforce Extensions for VS Code v44 is released on October 13, 2018, replacing the beta version that was released in Summer ’18.
6. Opt Into Fire Platform Events from Batch Apex Classes (Beta)
Batch Apex classes can now opt-in to fire platform events when encountering an error or exception. Event records provide more granular tracking of errors than the Apex Jobs UI. You can get access to information like which records were in scope at the time of failure, and other exception details. Events are also fired for Salesforce Platform internal errors and other “uncatchable” Apex exceptions like LimitExceptions that are caused by reaching governor limits.
To fire a platform event, a batch Apex class declaration must implement the Database.RaisesPlatformEvents interface.
7. Use Inherited Sharing to Secure Your Apex Code
Apex class without a sharing declaration is insecure by default. The sharing is inherited by the caller of the class. For example, if a trigger calls an Apex class and the class has no sharing declaration, then the class runs without sharing because the Trigger always runs in System mode.
You can now specify the inherited sharing keyword on an Apex class, which allows the class to run in the sharing mode of the class that is called it. Using inherited sharing enables you to pass security review and ensure that your privileged Apex code is not used in unexpected or insecure ways.
How: This example declares an Apex class with inherited sharing and a Visualforce invocation of that Apex code. Because of the inherited sharing declaration, only contacts for which the running user has shared access are displayed. If the declaration is omitted, even contacts that the user has no right to view are displayed due to the insecure default behavior of omitting the declaration.
8. Reference Custom Metadata Types in Advanced Formula Fields
Create a custom metadata type, and reference its records in an advanced formula field. Store parameters for your formula in custom metadata types. If you need to make a change, you can do so in your custom metadata type instead of changing multiple, hard-coded formulas.
Let’s say you have several formulas that pertain to wheel sizes. Some formulas perform calculations to confirm that the wheel circumference size is accurate, while others perform vehicle drive-train calculations. If the wheel dimensions for a specific brand change, you can update your custom metadata type rather than the individual formulas.
9. Instantiate Custom Metadata Types in Apex
You can now edit custom metadata records in memory within Apex. Previously, custom metadata records queried with SOQL in Apex were immutable. Audit fields (CreatedDate, CreatedBy, LastModifiedDate, LastModifiedBy, SystemModStamp) and calculated fields remain uneditable. DML operations aren’t allowed on custom metadata in Apex or the Partner or Enterprise APIs. DML operations can be done with the Apex Metadata API.
Below example, the first method is instantiating a custom metadata record, but no records are inserted into memory. The second method retrieves a record, changes it, and returns it to the caller, but the change is not updated in the database.
10. Visual Studio Code is now available for normal orgs (Beta)
Connect to any org to retrieve and deploy sources from Visual Studio Code. Previously, you could use Salesforce Extensions for VS Code only with scratch orgs. Salesforce Extensions for VS Code is the flagship development environment for customizing Salesforce with code. The ability to connect to and develop against any org enables you to start using Visual Studio Code, even if you don’t work exclusively with scratch orgs.
No comments:
Post a Comment