Close Menu
SalesforceCodex
    Facebook X (Twitter) Instagram
    Trending
    • Top 10 Salesforce Flow Features of Salesforce Summer ’25
    • Unlock the Power of Vibe Coding in Salesforce
    • How to Implement Dynamic Queueable Chaining in Salesforce Apex
    • How to Implement Basic Queueable Chaining in Salesforce Apex
    • How to Suppress PMD Warnings in Salesforce Apex
    • Top 10 PMD Issues Salesforce Developers Should Focus on in Apex
    • How to Use Graph API for Outlook-Salesforce Connection
    • Enhancing Performance with File Compression in Apex
    Facebook X (Twitter) Instagram
    SalesforceCodex
    Subscribe
    Friday, May 16
    • Home
    • Architecture
    • Salesforce
      • News
      • Apex
      • Integration
      • Books Testimonial
    • Questions
    • Certification
      • How to Prepare for Salesforce Integration Architect Exam
      • Certification Coupons
    • Integration Posts
    • Downloads
    • About Us
      • Privacy Policy
    SalesforceCodex
    Home»Salesforce»Salesforce Winter 20 Release – Feature Enhancements For Apex

    Salesforce Winter 20 Release – Feature Enhancements For Apex

    Dhanik Lal SahniBy Dhanik Lal SahniAugust 28, 2019Updated:June 3, 2020No Comments3 Mins Read
    Facebook Twitter Pinterest LinkedIn Tumblr Email
    Salesforce Winter 20 Release – Feature Enhancements For Apex
    Share
    Facebook Twitter LinkedIn Pinterest Email

    Salesforce ‘Apex got lot of enhancement in Winter 20 release. Some of security features are moved from Pilot to Beta version.  Methods are added in classes for security and test frameworks. Let us see those enahncement.

    Enforce Field-Level Security in Apex (Beta)

    stripInaccessible method is used to strip the fields that the current user can’t access from query and subquery results. We can use it to remove inaccessible fields from sObjects before a DML operation to avoid exceptions. We can also use the method to sanitize sObjects that have been deserialized from an untrusted source.
    This method was in Pilot stage and now it is moved in Beta version. In Winter ’20, we can use new enum with the stripInaccessible method to enforce field- and object-level checks for both insert and update.

    How to use this method:

    The stripInaccesible method checks the source records for subquery fields that don’t meet the field-level security check for the current user. The method returns a list of sObjects that contain only the fields that are accessible to the current user. If the user doesn’t have access to the relationship field from child to parent, the return list of sObjects doesn’t include the child relationship.

    List<Account> accountsWithContacts =
    	[SELECT Id, Name, Phone,
    	    (SELECT Id, LastName, Phone FROM Account.Contacts)
    	FROM Account];
      
    // Strip fields that are not readable
       SObjectAccessDecision decision = Security.stripInaccessible(
    	                                   AccessType.READABLE,
    	                                   accountsWithContacts);
     
    // Print stripped records
       for (Integer i = 0; i < accountsWithContacts.size(); i++) 
      {
          System.debug('Insecure record access: '+accountsWithContacts[i]);
          System.debug('Secure record access: '+decision.getRecords()[i]);
       }
     
    // Print modified indexes
       System.debug('Records modified by stripInaccessible: '+decision.getModifiedIndexes());
     
    // Print removed fields
       System.debug('Fields removed by stripInaccessible: '+decision.getRemovedFields());

    If the user doesn’t have permission to read the Phone field of a Contacts object, above example code removes the subquery field before reading the records. The DML operation completes without throwing an exception.

    Excluded Callouts from Long-Running Request Limit

    Every org has a limit on the number of concurrent long-running Apex requests. This limit counts all requests that run for more than 5 seconds (total execution time). However, HTTP callout processing time is no longer included when calculating the 5-second limit. We pause the timer for the callout and resume it when the callout completes.

    This change applies to callouts made directly from Apex, including SOAP callouts generated by WSDL2Apex. It also applies to callouts from other platform features, such as External Services and External Objects.

    ApexSettings Metadata Type

    ApexSettings metadata type is added to augment Apex testing with aggregate total tracking, serial execution, and prevention of auto-number gaps. We can also use ApexSettings to suppress debug log details in unhandled exception emails.

    We can use the ApexSettings metadata type in many ways.

    • To enable tracking of aggregate, instead of detailed, totals for Apex test coverage data, use the new enableAggregateCodeCoverageOnly field.
    • To enable serial execution of Apex tests, use the new enableDisableParallelApexTesting field.
    • To suppress Apex debug log details in unhandled exception emails, use the new enableDoNotEmailDebugLog field.
    • To prevent Apex test executions from incrementing auto-number fields for non-test records and creating gaps, use the newenableGaplessTestAutoNum field.

    Reference :

    https://releasenotes.docs.salesforce.com/en-us/winter20/release-notes/rn_apex.htm

    apex salesforce Winter 20
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
    Previous ArticleSalesforce Winter 20 Release – Feature Enhancements For Development
    Next Article Winter 20 Release – Code Enhancement in LWC
    Dhanik Lal Sahni
    • Website

    Related Posts

    By Dhanik Lal Sahni6 Mins Read

    Top 10 Salesforce Flow Features of Salesforce Summer ’25

    May 11, 2025
    By Dhanik Lal Sahni6 Mins Read

    Unlock the Power of Vibe Coding in Salesforce

    April 30, 2025
    By Dhanik Lal Sahni5 Mins Read

    How to Implement Dynamic Queueable Chaining in Salesforce Apex

    April 21, 2025
    Add A Comment
    Leave A Reply Cancel Reply

    Ranked #1 SALESFORCE DEVELOPER BLOG BY SALESFORCEBEN.COM
    Featured on Top Salesforce Developer Blog By ApexHours
    Recent Posts
    • Top 10 Salesforce Flow Features of Salesforce Summer ’25
    • Unlock the Power of Vibe Coding in Salesforce
    • How to Implement Dynamic Queueable Chaining in Salesforce Apex
    • How to Implement Basic Queueable Chaining in Salesforce Apex
    • How to Suppress PMD Warnings in Salesforce Apex
    Ranked in Top Salesforce Blog by feedspot.com
    RSS Recent Stories
    • How to Connect Excel to Salesforce to Manage Your Data and Metadata February 9, 2025
    • Difference Between With Security and Without Security in Apex January 2, 2025
    • Top Reasons to Love Salesforce Trailhead: A Comprehensive Guide December 5, 2024
    • How to Utilize Apex Properties in Salesforce November 3, 2024
    • How to Choose Between SOQL and SOSL Queries July 31, 2024
    Archives
    Categories
    Tags
    apex (110) apex code best practice (8) apex rest (11) apex trigger best practices (4) architecture (22) Asynchronous apex (9) AWS (5) batch apex (9) batch processing (4) code optimization (8) code review tools (3) custom metadata types (5) design principle (9) einstein (3) flow (15) future method (4) google (6) google api (4) integration (19) integration architecture (6) lighting (8) lightning (64) lightning-combobox (5) lightning-datatable (10) lightning component (29) Lightning web component (61) lwc (50) named credential (8) news (4) optimize apex (3) optimize apex code (4) Permission set (4) Queueable (9) rest api (23) S3 Server (4) salesforce (140) salesforce apex (46) salesforce api (4) salesforce api integration (5) Salesforce Interview Question (4) salesforce news (5) salesforce question (5) solid (6) tooling api (5) Winter 20 (8)

    Get our newsletter

    Want the latest from our blog straight to your inbox? Chucks us your detail and get mail when new post is published.
    * indicates required

    Ranked #1 SALESFORCE DEVELOPER BLOG BY SALESFORCEBEN.COM
    Featured on Top Salesforce Developer Blog By ApexHours
    Recent Posts
    • Top 10 Salesforce Flow Features of Salesforce Summer ’25
    • Unlock the Power of Vibe Coding in Salesforce
    • How to Implement Dynamic Queueable Chaining in Salesforce Apex
    • How to Implement Basic Queueable Chaining in Salesforce Apex
    • How to Suppress PMD Warnings in Salesforce Apex
    Ranked in Top Salesforce Blog by feedspot.com
    RSS Recent Stories
    • How to Connect Excel to Salesforce to Manage Your Data and Metadata February 9, 2025
    • Difference Between With Security and Without Security in Apex January 2, 2025
    • Top Reasons to Love Salesforce Trailhead: A Comprehensive Guide December 5, 2024
    • How to Utilize Apex Properties in Salesforce November 3, 2024
    • How to Choose Between SOQL and SOSL Queries July 31, 2024
    Archives
    Categories
    Tags
    apex (110) apex code best practice (8) apex rest (11) apex trigger best practices (4) architecture (22) Asynchronous apex (9) AWS (5) batch apex (9) batch processing (4) code optimization (8) code review tools (3) custom metadata types (5) design principle (9) einstein (3) flow (15) future method (4) google (6) google api (4) integration (19) integration architecture (6) lighting (8) lightning (64) lightning-combobox (5) lightning-datatable (10) lightning component (29) Lightning web component (61) lwc (50) named credential (8) news (4) optimize apex (3) optimize apex code (4) Permission set (4) Queueable (9) rest api (23) S3 Server (4) salesforce (140) salesforce apex (46) salesforce api (4) salesforce api integration (5) Salesforce Interview Question (4) salesforce news (5) salesforce question (5) solid (6) tooling api (5) Winter 20 (8)

    Get our newsletter

    Want the latest from our blog straight to your inbox? Chucks us your detail and get mail when new post is published.
    * indicates required

    Facebook X (Twitter) Instagram Pinterest YouTube Tumblr LinkedIn Reddit Telegram
    © 2025 SalesforceCodex.com. Designed by Vagmine Cloud Solution.

    Type above and press Enter to search. Press Esc to cancel.

    Ad Blocker Enabled!
    Ad Blocker Enabled!
    Our website is made possible by displaying online advertisements to our visitors. Please support us by disabling your Ad Blocker.