Toggle Side Panel

  • Home
  • Articles
    • All Articles
    • Blogs
    • Videos
    • Infographics
  • Consultants
    • Salesforce Product Expertise
      • Top Salesforce ConsultantsTop Salesforce Consultants
      • Marketing Cloud ConsultantsMarketing Cloud Consultants
      • Service Cloud ConsultantsService Cloud Consultants
      • Experience Cloud ConsultantsExperience Cloud Consultants
      • Analytics Cloud ConsultantsAnalytics Cloud Consultants
    • Salesforce Industry Expertise
      • Non-Profit Cloud ConsultantsNon-Profit Cloud Consultants
      • Financial Service Cloud ConsultantsFinancial Service Cloud Consultants
      • Health Cloud ConsultantsHealth Cloud Consultants
      • Commerce Cloud ConsultantsCommerce Cloud Consultants
      • Manufacturing Cloud ConsultantsManufacturing Cloud Consultants
    • Salesforce Experts by Location
      • USATop Salesforce Consultants in USA
      • IndiaTop Salesforce Consultants in India
      • AustraliaTop Salesforce Consultants in Australia
      • United KingdomTop Salesforce Consultants in UK
      • CanadaTop Salesforce Consultants in Canada
  • Webinars
  • Marketplace
  • Advertise With Us
  • Contact Us
  • Discussions
More options
    Sign in Sign up
    • Home
    • Articles
      • All Articles
      • Blogs
      • Videos
      • Infographics
    • Consultants
      • Salesforce Product Expertise
        • Top Salesforce ConsultantsTop Salesforce Consultants
        • Marketing Cloud ConsultantsMarketing Cloud Consultants
        • Service Cloud ConsultantsService Cloud Consultants
        • Experience Cloud ConsultantsExperience Cloud Consultants
        • Analytics Cloud ConsultantsAnalytics Cloud Consultants
      • Salesforce Industry Expertise
        • Non-Profit Cloud ConsultantsNon-Profit Cloud Consultants
        • Financial Service Cloud ConsultantsFinancial Service Cloud Consultants
        • Health Cloud ConsultantsHealth Cloud Consultants
        • Commerce Cloud ConsultantsCommerce Cloud Consultants
        • Manufacturing Cloud ConsultantsManufacturing Cloud Consultants
      • Salesforce Experts by Location
        • USATop Salesforce Consultants in USA
        • IndiaTop Salesforce Consultants in India
        • AustraliaTop Salesforce Consultants in Australia
        • United KingdomTop Salesforce Consultants in UK
        • CanadaTop Salesforce Consultants in Canada
    • Webinars
    • Marketplace
    • Advertise With Us
    • Contact Us
    • Discussions
    Close search

    Activity › Forums › Salesforce® Discussions › Explain System.runAs() in Salesforce.

    Tagged: Account, Record Sharing, Salesforce Apex Code, System.runAs, Test Method

    • Salesforce® Discussions

      Explain System.runAs() in Salesforce.

      Posted by Aman on September 22, 2018 at 10:25 PM

      Explain System.runAs() in Salesforce.

      shariq replied 7 years, 4 months ago 2 Members · 1 Reply
      • Account
      • Record Sharing
      • Salesforce Apex Code
      • System.runAs
      • Test Method
    • 1 Reply
    • shariq

      Member
      September 22, 2018 at 10:25 PM

      Generally, all Apex code runs in system mode, and the permissions and record sharing of the current user are not taken into account. The system method, System.runAs(), lets you write test methods that change user contexts to either an existing user or a new user. All of that user’s record sharing is then enforced. You can only use runAs in a test method. The original system context is started again after all runAs() test methods complete.

    Log In to reply.

    • Public
    • All Members
    • My Connections
    • Only Me
    • Public
    • All Members
    • My Connections
    • Only Me
    • Public
    • All Members
    • My Connections
    • Only Me

    application solution

    Popular Salesforce Blogs

    Managed and Unmanaged packages in Salesforce in 2023 | All You Need to Know

    Managed and Unmanaged packages in Salesforce in 2023 | All You Need to Know

    Blog in Salesforce

    What are the various types of packages in Salesforce? Let's understand! Unmanaged Package Think of it as a beautifully wrapped gift box that you can…

    API, App Launcher, AppExchange Marketplace, Build Package Versions, Classes and Components
    NAVDITA DAHIYA Mar 27, 2023
    1,821  Views

    Everything You Need to Know for the World's Biggest Salesforce Dreamforce 2025!

    Blog in Others

    Salesforce is one of the biggest CRM platforms in the world. Almost every mid- to high-level organization utilizes it for seamless workflow within departments and…

    Ray brad Aug 1, 2025
    339  Views

    Top Salesforce Products to Boost Your Sales Team's Performance in 2023

    Blog in Salesforce Products

    Salesforce is a cloud-based platform that offers comprehensive support to businesses in managing their communication with individual clients from start to finish. This article highlights…

    App Cloud, audiences, Automation options, Business actions, Businesses
    Outsource Management Inc. Apr 24, 2023
    877  Views

    Popular Salesforce Videos

    Validation Rules in Salesforce | Video Tutorial Guide

    Validation Rules in Salesforce | Video Tutorial Guide

    Video in Salesforce Implementation

    In this video, Srinu Namani briefs about Validation Rules in Salesforce. Validation rules are an important part of keeping your data clean and organized, and…

    Salesforce Training, Salesforce Tutorial, salesforce, Salesforce Data, Data Validation
    Mayra Nov 4, 2022
    1,636  Views
    Why Users Cannot be Deleted from Salesforce | How to Delete User from Salesforce?

    Why Users Cannot be Deleted from Salesforce | How to Delete User from Salesforce?

    Video in Salesforce Stories

    Why users cannot be deleted from Salesforce and how to delete users from Salesforce? Watch this video and learn all about it. Do let us…

    Salesforce Training, Salesforce Tutorial, salesforce, Salesforce Video, Salesforce Users
    Pooja Jan 28, 2022
    1,640  Views
    Salesforce Tutorial For Beginners | Introduction To Salesforce | Salesforce Training

    Salesforce Tutorial For Beginners | Introduction To Salesforce | Salesforce Training

    Video in Salesforce Training

    This video on Salesforce training will help you understand the easy and best tool for CRM and Branding. You will learn how to customize the…

    Salesforce Training, Salesforce Tutorial, Salesforce Tutorial for Beginners, Email Templates, salesforce
    Rupal Kakkar Dec 29, 2020
    1,901  Views
    Footer Forcetalks logo

    support@forcetalks.com

    • twitterx

    Quick Links

    Advertise with Us

    Salesforce® Articles

    Dreamforce 2023

    Top Salesforce® Bloggers 2023

    Top Salesforce Consultants

    Get Listed

    Company

    Contact Us

    About Us

    Privacy Policy

    Terms & Conditions

    InsightHub

    Salesforce Blogs

    Salesforce Videos

    Salesforce Groups

    Salesforce Jobs

    © 2026 - Forcetalks ● All Rights Reserved

    Salesforce® is a trademark of Salesforce® Inc. No claim is made to the exclusive right to use “Salesforce”. Any services offered within the Forcetalks website/app are not sponsored or endorsed by Salesforce®.

    Try AuditMyCRM - It is a Salesforce CRM Audit tool which comprehensively scans your Salesforce org and gives you the list of errors or warnings you need to take care of.
    We use cookies to enhance your browsing experience. Please see our privacy policy if you'd like more information on our use of cookies.