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 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

    improve Apex Code Unit using Salesforce Best practices

    Improve your Apex Code Unit | Salesforce Best Practices

    Blog in Salesforce Apex

    In this blog, we are going to discuss the best practice of Apex. Apex code is used to write custom business logic.  in any language,…

    Best Practices, Bulk Action, Bulkifying, Code Reusable, Custom Business Logic
    NAVDITA DAHIYA Nov 28, 2022
    2,905  Views

    Accelerating Vaccine Management With Salesforce's Vaccine Cloud

    Blog in Salesforce

    Local and international government officials and healthcare workers are currently delivering the most extensive mass vaccination campaign in human history. The formulation and creation of…

    Automated System, Avoid Surplus Supplies, Centralized Dashboard, Contact Tracing Systems, COVID Crisis
    Apphienz Apr 2, 2021
    3,669  Views
    Salesforce High-Velocity Sales

    All About Salesforce High-Velocity Sales

    Blog in Sales, Salesforce

    Salesforce is the most popular CRM among enterprises due to its extensive features and rich functionalities. The structure of the Salesforce Customer Relationship Management system is designed…

    Automatic Email, Business Handling Procedures, Business Procedures, Call the Lead, Continuous Updates
    SP Oct 22, 2021
    2,999  Views

    Popular Salesforce Videos

    Salesforce Einstein Keynote: AI for CRM

    Salesforce Einstein Keynote: AI for CRM

    Video in Salesforce Einstein

    Salesforce Einstein is delivering more than one billion predictions every day, helping companies get a new level of insight about their business and their customers.…

    Salesforce Apps, Artificial Intelligence, Sales Cloud Einstein, Salesforce Einstein, Salesforce CRM
    Prafull Apr 19, 2018
    1,998  Views
    Data Import: Clean and Prepare Your Data Using Excel | Salesforce

    Data Import: Clean and Prepare Your Data Using Excel | Salesforce

    Video in Data, Salesforce Training

    Cleaning and Preparing Data Using Excel covers several features and functions that will make quick work of getting your data files ready for import. Vlookup,…

    Salesforce Training, Salesforce Tutorial, salesforce, Salesforce Video, Salesforce Learning
    Rupal Kakkar Oct 26, 2021
    2,364  Views
    Entrepreneurship in the Salesforce Ecosystem

    Entrepreneurship in the Salesforce Ecosystem

    Video in Salesforce Stories

    The Salesforce Women’s Entrepreneur Group is a group of women who have founded and own businesses in the Salesforce ecosystem. Our goal is to inspire,…

    Salesforce Training, Salesforce Tutorial, salesforce, Salesforce Ecosystem, Salesforce Video
    Pooja Apr 12, 2021
    2,001  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.