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 Consulting Services Companies Must Know 8 Things

    Blog in Salesforce

    Salesforce is more than just a CRM it can help you with all aspects of your business. If you do it right, and depending on…

    Business, Business Intelligence, Cloud Analogy, Cloud Marketing, Cloud-based Business Intelligence
    Hennery cavil Aug 30, 2023
    1,139  Views

    How Does Network-as-a-Service Benefit Your Business | Salesforce

    Blog in Salesforce

    Network-as-a-Service (NaaS) is a framework for delivering network services over the internet. It is also a business model in which a service provider provides network…

    Business, Business Model, Business Needs, Cloud Computing, Cloud-based Applications
    Apphienz Oct 7, 2022
    2,756  Views
    Opportunity Line Item

    Opportunity Line Item | Salesforce Developer Guide

    Blog in Salesforce Training

    An opportunity is a pending agreement with a monetary value attached to it. It denotes that if the Opportunity is closed successfully, the $ amount…

    Area, Business, Case, Client, Contacts
    Arpit Nov 25, 2021
    11,325  Views

    Popular Salesforce Videos

    Salesforce AppExchange Pricing Models

    Salesforce AppExchange Pricing Models

    Video in AppExchange

    Salesforce AppExchange offers a wide range of solutions and applications designed to enhance and extend the functionality of Salesforce. However, understanding the pricing models can…

    Salesforce Developer, salesforce, Salesforce Apps, Salesforce Hulk, Salesforce Webinar
    Cyntexa Aug 22, 2023
    1,578  Views
    7 Lightning Flow Features in Salesforce Winter '20 Release

    7 Lightning Flow Features in Salesforce Winter '20 Release

    Video in Others, Lightning

    Lightning Flow Builder is an automation tool within salesforce.com CRM. It's declarative, clicks not code, a tool that can perform both fully automated and custom…

    Salesforce Lightning, salesforce platform, Salesforce VIdeos, Lightning Flow Builder, Cloud Designer
    Pooja Feb 27, 2020
    2,221  Views
    How To Become a Salesforce Developer [Perfect Guide for Beginners]

    How To Become a Salesforce Developer [Perfect Guide for Beginners]

    Video in Others

    Curious about a career in Salesforce development? Our video is your concise guide to getting started.  What's inside:→ The average salary for a Salesforce Developer…

    ENWAY Sep 5, 2025
    141  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.