• Skip to main content
  • Skip to primary sidebar
  • Skip to footer
  • Home
  • Blog
  • Contact

Salesforce Insider

Salesforce News, Reviews, and Analysis

Utilize Apex Security Enhancements to Reduce Development Time

August 17, 2020 by Mike Faust Leave a Comment

Building security into your ISV application is an essential part of providing trust to your customers. It’s so important that there is a security review process that every ISV application must pass to be listed on the AppExchange.

With the Spring ’20 release come two enhancements that drastically reduce the amount of code you have to write while reducing CPU time and heap size: WITH SECURITY_ENFORCED and Security.stripInaccessible().

WITH SECURITY_ENFORCED

The WITH SECURITY_ENFORCED clause enables field and object-level security checks directly in SOQL select queries in Apex Code, including subqueries and cross-object relationships. This is only needed for queries executed in Apex as Apex runs in system mode whereas queries executed via APIs enforce CRUD/FLS access.

The security is checked before the query execution. If any fields or objects referenced in the SOQL SELECT query using WITH SECURITY_ENFORCED are inaccessible to the user, a System.QueryException is thrown, and no data is returned. So you’ll still

Filed Under: Blogs

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Primary Sidebar

More to See

Optimizer Is Sunsetting: Learn How To Use Org Check | Kate Clicks Through It

August 5, 2025 By Kate Lessard

Admin Release Countdown: Get Ready for Winter ’26

August 4, 2025 By Zoe Vasquez

Breaking Into Tech With a Nontraditional Background

July 31, 2025 By Joshua Birk

Introducing True to the Core Deep Dive: In-Depth Product Conversations with Salesforce PMs

July 29, 2025 By LeeAnne Rimel

Inside Our Hackathon Build: Case Automation on Agentforce in 9 Steps

July 28, 2025 By Anna Bromley

Footer

About Salesforce Insider

Salesforce Insider is your one-stop shop for Salesforce news, reviews, and analysis.

Do you have something to share? Contact us and let us know!

Recent

  • Optimizer Is Sunsetting: Learn How To Use Org Check | Kate Clicks Through It
  • Admin Release Countdown: Get Ready for Winter ’26
  • Breaking Into Tech With a Nontraditional Background
  • Introducing True to the Core Deep Dive: In-Depth Product Conversations with Salesforce PMs
  • Inside Our Hackathon Build: Case Automation on Agentforce in 9 Steps

Search

Copyright © 2026 · Salesforce Insider