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

    application solution

    Popular Salesforce Blogs

    The New Marketing Cloud Growth Edition: All You Need to Know

    The New Marketing Cloud Growth Edition: All You Need to Know

    Blog in Salesforce

    The Marketing Hustle for Small Businesses Running a small business is an exciting journey, but keeping up with marketing demands can feel overwhelming. Limited resources…

    Automated Tasks, Business Growth, Customer Data Analysis, Customer Engagement, Customer Relationship Management
    SP May 16, 2024
    1,069  Views
    Single Sign-on

    Single Sign-on (SSO) for Salesforce with Microsoft Azure AD

    Blog in Salesforce, Salesforce integration

    What Is SSO? SSO is an abbreviation of Single Sign-On. It is a method for granting access to multiple applications to users with a single…

    App Name, Application Gallery, Application Group, Authentication Configuration, Authentication of Multiple Apps
    SP Oct 4, 2021
    5,580  Views

    AgentForce AI Agents: Automate Sales & Support in Salesforce

    Blog in Others

    Businesses using Salesforce can improve their sales and customer support with AgentForce AI agents. These AI-powered tools help teams work faster, automate tasks, and improve…

    360degreecloud Salesforce Aug 1, 2025
    153  Views

    Popular Salesforce Videos

    Which Objects are in the Salesforce Sales Cloud and Service Cloud?

    Which Objects are in the Salesforce Sales Cloud and Service Cloud?

    Video in Salesforce Cloud Platform

    Salesforce comes with a large number of standard objects that are integral to Salesforce, but you can also create custom objects. We’ve compiled a list…

    Salesforce Tutorial, Salesforce Sales Cloud, Salesforce Service Cloud, SOAP, Apex SOAP API
    Abhay Jan 19, 2018
    4,956  Views
    Learn About How to Set Profiles in Salesforce?

    Learn About How to Set Profiles in Salesforce?

    Video in Salesforce Admin

    Learn about Profiles in Salesforce and types of profiles, Standard and Custom Profiles. Watch this video and do let us know in the comment section…

    Salesforce Training, salesforce, salesforce knowledge, Profiles In Salesforce, Salesforce Video
    CRS Apr 5, 2022
    1,365  Views
    4 Salesforce Report Formulas To Enhance Your Sales Process

    4 Salesforce Report Formulas To Enhance Your Sales Process

    Video in Salesforce Consultant

    Salesforce is a highly effective tool that can help businesses manage their customer relationships and sales processes. In this video, you will learn 4 helpful…

    Salesforce Consultant, salesforce, CRM, Salesforce Admin, Salesforce Video
    ENWAY Nov 9, 2023
    767  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

    © 2025 - 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.