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

    Engaging User Communities with Salesforce Experience Cloud

    Blog in Salesforce Cloud Platform

    For years, Salesforce customers have leveraged communities to deliver Salesforce-powered interactions to their users. However, these communities were limited to singular portals and websites. In…

    Brand Experience, Business Functions, communities, Communities in Experience Cloud, Community Building
    GS Lab Nov 21, 2022
    2,325  Views

    Salesforce Sales Cloud Implementation Guide

    Blog in Salesforce

    Implementing Salesforce Sales Cloud is one of the most effective ways for businesses to strengthen their sales operations, improve lead management, and boost revenue growth.…

    Cloud CRM Solutions, Sales Automation, Salesforce Consulting, Salesforce Sales Cloud Implementation, Salesforce Sales Cloud Services
    Dean Nov 24, 2025
    164  Views
    Validation Rules in Salesforce All You Need to Know

    Validation Rules in Salesforce | All You Need to Know

    Blog in Salesforce

    Validation rules in Salesforce are used to enforce data quality by ensuring that data entered into Salesforce meets certain standards. They are used to validate…

    Create Validation Rules, Custom Validation, Data Validation Rules, Description, Detailed Object List
    Pranjal Feb 15, 2023
    2,740  Views

    Popular Salesforce Videos

    Salesforce Financial Services Cloud Implementation Guide

    Salesforce Financial Services Cloud Implementation Guide

    Video in Salesforce Cloud Platform, Salesforce Implementation

    You’ve decided to use Salesforce Financial Services Cloud but where do you begin? How can you utilize Salesforce to track all your customer interactions and…

    Salesforce Training, Salesforce Development, Salesforce Integration, Salesforce Consulting, Salesforce Video
    DB Aug 31, 2023
    1,325  Views
    Using Salesforce as a Sales Rep | Salesforce Tutorials

    Using Salesforce as a Sales Rep | Salesforce Tutorials

    Video in Salesforce Stories, Sales

    Sales Rep Overview is for reps that own opportunities and carry a quota. Gain instant insight into your business over any time frame. Track won…

    Salesforce Training, salesforce, Salesforce Video, sales, Salesforce Learning
    Rupal Kakkar Jun 21, 2022
    2,013  Views
    Top 50 Salesforce Lightning Interview Questions And Answers | Salesforce Lightning Interview

    Top 50 Salesforce Lightning Interview Questions And Answers | Salesforce Lightning Interview

    Video in Lightning

    This video by MindMajix includes all the frequently asked Interview questions that give you an idea to crack your Salesforce Lightning interview smartly. These Interview…

    Salesforce Training, Salesforce Tutorial, Salesforce Lightning, salesforce, Salesforce Video
    Rahul kapoor Jan 3, 2023
    2,125  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.