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

    Popular Salesforce Blogs

    Salesforce Links Einstein GPT and Data Cloud to Flow

    Blog in Salesforce

    Salesforce links Einstein GPT and Data Cloud to Flow to drive the autonomous, intelligent enterprise by integrating AI-generated content with real-time customer data to automate…

    Automate Workflows, Automation, code generation, Complex Workflows, Composing emails
    Apphienz May 30, 2023
    1,595  Views
    salesforce commerce solutions

    New Commerce Solutions on Salesforce AppExchange

    Blog in Others

    In case you're a Commerce Cloud client, you can now effectively discover, attempt, and purchase applications to make a total trade arrangement with applications for…

    API-first Methodology, AppExchange, Applications for Installments, Avalara, B2B index
    Pooja Jul 10, 2020
    3,999  Views

    How to do a Successful Marketing Cloud Personalization Implementation?

    Blog in Salesforce Cloud Platform

    To personalize and manage real-time interactions with your customers, Salesforce Marketing Cloud Personalization is a potent tool. But you need to plan and execute it…

    Business Goals, Business Users, Cloud Computing, cloud-service-provider, Cross-functional Collaboration
    Concretio Feb 20, 2024
    1,849  Views

    Popular Salesforce Videos

    Security in Salesforce - What Developers Must Know

    Security in Salesforce - What Developers Must Know

    Video in Salesforce Security

    Security in Salesforce 0:00​ Introduction 3:00​ Agenda 4:05​ Data security 5:18​ User Mode & System Mode 9:13​ CRUD & FLS Data Model 10:45​ Enforcing CRUD…

    Salesforce Training, Apex Class, Salesforce Lightning, Salesforce Developers, Salesforce Video
    Prafull May 4, 2021
    2,124  Views
    Use Salesforce Notification Builder to Get Notifications to the Right Users in the Right Apps

    Use Salesforce Notification Builder to Get Notifications to the Right Users in the Right Apps

    Video in Salesforce Training, Salesforce Apps

    Did you know you can use Notification Builder to create custom notifications for teams, task queues, and public groups? You can also replace standard notifications…

    Salesforce Training, salesforce, Salesforce Video, Salesforce Learning, Salesforce Notification Builder
    Prafull Jul 28, 2020
    2,261  Views
    Understanding Service Cloud & Case Management in Salesforce

    Understanding Service Cloud & Case Management in Salesforce

    Video in Sales, Salesforce Cloud Platform

    In this video, Shrey is not only teaching but also demonstrating the Basics of Salesforce Service Cloud and Case Management. You will be learning: 1.…

    Salesforce Training, Salesforce Service Cloud, Salesforce Administrator, salesforce, Salesforce Video
    Jogender Mar 9, 2021
    2,103  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.