Toggle Side Panel

  • Blogs
  • 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
  • Contact Us
  • Discussions
More options
    Sign in Sign up
    • Blogs
    • 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
    • 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 8 years, 2 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

    Popular Salesforce Blogs

    5 Benefits of Automation with MuleSoft | Salesforce

    Blog in Salesforce Ecosystem

    The benefits of bringing DevOps tools into your IT Organization are many and well documented. Regardless of the technologies in play, continuous delivery and release automation help teams deliver higher…

    API Management Platform, Application, Automation with MuleSoft, Azure Key Vault, Cloud Implementations
    Flexagon May 11, 2022
    2,149  Views
    Integration Basics

    Integration Basics in Salesforce - Here is All You Need to Know

    Blog in Salesforce Apex, Salesforce integration

     Have you ever wondered why there are so many applications and software out there and how they interact with each other since there’s a sea…

    API, Applications, Applications and Software, Callout, Developer
    Akash Varshney Sep 19, 2022
    2,688  Views
    salesforce integration

    Common Mistakes while Performing Salesforce Integration: What not to do

    Blog in Salesforce integration

    Integration means combining two different systems, portals, applications, etc with each other in order to make them as one application. Integration is very widely implemented…

    API calls, Applications, Data Management, Data Management Strategy, Data Mapping
    Algoworks May 19, 2020
    2,707  Views

    Popular Salesforce Videos

    Dynamic Action in Salesforce | Salesforce Tutorial

    Dynamic Action in Salesforce | Salesforce Tutorial

    Video in Salesforce Training

    In this video, we are going to talk all about dynamic actions in Salesforce. 00:00 Introduction 00:57 Work with Dynamic Action 05:05 Dynamic Actions in…

    Salesforce Training, Salesforce Tutorial, salesforce, Salesforce Video, Salesforce Learning
    Prafull Aug 27, 2021
    1,585  Views
    Salesforce for Marketing

    Salesforce for Marketing

    Video in Marketing

    Learn how to bring marketing and engagement together. Salesforce Marketing Cloud helps you connect marketing, sales, service, and more on a single platform. Marketers get…

    Salesforce Marketing Cloud, Salesforce Video, sales, Marketing, Service
    Manpreet Jun 12, 2020
    1,701  Views
    Salesforce Service Cloud Einstein Bots

    Salesforce Service Cloud Einstein Bots

    Video in Salesforce Einstein

    Learn how to set up and use Einstein Bots to increase case deflection and reduce service costs through self-service. This webinar gives you a guided…

    salesforce, Salesforce Einstein, Salesforce Video, Service Cloud, customer service
    Jogender Sep 18, 2020
    2,975  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®.

    We use cookies to enhance your browsing experience. Please see our privacy policy if you'd like more information on our use of cookies.