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

    Salesforce Development Vs. Traditional Development

    Blog in Salesforce

    The competitive nature of present living standards has always kept every individual in the race for success. The urge to grab the crown and be…

    Best Security, Building and Managing CRM Apps, Business, ButtonClick Admin, CLOUD
    Gopal Krishna Mishra Oct 9, 2020
    3,108  Views
    Merge Duplicate Accounts

    How to Merge Duplicate Accounts & Contacts in Salesforce Lightning

    Blog in Lightning

    The differences are stark between the Salesforce Classic and the Salesforce Lightning Experience when it comes to duplicates records. In Salesforce Lightning duplicate alerts are…

    Duplicate Records, Salesforce Classic, Salesforce Database, Salesforce Lightning, Salesforce Lightning Consultants
    Emily May 8, 2019
    27,694  Views

    Optimizing Your Salesforce Org Documentation: An Automated Revolution

    Blog in Others

    In the rapidly evolving landscape of Salesforce management, the demand for streamlined processes and enhanced productivity has become paramount. This blog post unveils a groundbreaking…

    Automated Documentation, Automated Documentation Process, Automated Processes, Automated Revolution, Documentation Accuracy
    John Apr 8, 2024
    791  Views

    Popular Salesforce Videos

    Rise & Shine with The Salesforce Women's Entrepreneur Group - May Series

    Rise & Shine with The Salesforce Women's Entrepreneur Group - May Series

    Video in Salesforce Stories

    The Salesforce Women’s Entrepreneur Group invites you to our first quarterly event of the year, Rise & Shine - Celebrating Women’s History Month. We are…

    Salesforce Training, Salesforce Ecosystem, Salesforce Video, Salesforce Learning, Businesses
    Rupal Kakkar May 18, 2021
    1,802  Views
    Schedule-Triggered Flow to Update Cases at the End of the Day | Schedule a Flow in Salesforce

    Schedule-Triggered Flow to Update Cases at the End of the Day | Schedule a Flow in Salesforce

    Video in Salesforce Training, Salesforce Admin

    A schedule-triggered flow starts at the specified time and frequency for a batch of records. Configure the schedule trigger in the Start element of your…

    Salesforce Training, Salesforce Tutorial, Salesforce Flow, Salesforce Video, Salesforce Learning
    Shubham Jan 18, 2021
    2,524  Views
    Salesforce Connect ( Cross-Org Adaptor ) | Salesforce Tutorial

    Salesforce Connect ( Cross-Org Adaptor ) | Salesforce Tutorial

    Video in Salesforce Training

    This video will talk about external objects using Salesforce Connect, also known as Cross-Org Adaptor. 00:00 Introduction 00:29 Introduction to Cross Org Adapter 01:51 Create…

    Salesforce Tutorial, Salesforce Video, Salesforce Learning, Salesforce Connect, Cross-Org Adaptor
    Prafull Jul 15, 2021
    1,430  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.