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

    All About Salesforce Customer Service Management

    Blog in Salesforce

    Every business must always strive to give the best customer service possible. It's not just about being all smiles in front of them, but also…

    Brand Recognition, Business, Business Goals, Business Performance, Business Success
    Apphienz Mar 22, 2022
    1,805  Views
    salesforce customer retention

    Effective Ways To Use Salesforce For Customer Retention

    Blog in AppExchange, Salesforce

    Why is Customer Retention Important? When techniques are implemented by way of sales groups to hold clients, revenue is going up and fees go down.…

    AppExchange Tools, Client Connections, Customer, Customer Data, Customer Experience
    Sumit kumar May 12, 2020
    3,304  Views
    Calling from Salesforce

    Calling from Salesforce: Use RingCentral

    Blog in Lightning

    Hello Everyone, Salesforce is nowadays a huge platform for all the developers, administrators, and users as well. So in this tech world, everyone needs a…

    Calling from Salesforce, Cloud Computing, Cloud Computing Salesforce, productivity, Salesforce AppExchange
    PRANAV Mar 26, 2018
    3,680  Views

    Popular Salesforce Videos

    How Cross Channel Marketing Can Drive More Engagement ? | Salesforce Marketing Cloud

    How Cross Channel Marketing Can Drive More Engagement ? | Salesforce Marketing Cloud

    Video in Marketing, Salesforce Training

    Cross-channel marketing is a customer-focused digital marketing technique used by marketers globally to provide an integrated experience across all paid, owned, earned media, and digital…

    Salesforce Training, Salesforce Tutorial, Salesforce Marketing Cloud, Salesforce Webinar, Salesforce Video
    Cyntexa Jan 11, 2023
    1,196  Views
    Survival Kit for Beginner Salesforce Developers - 1

    Survival Kit for Beginner Salesforce Developers - 1

    Video in Salesforce Training

    Are you a developer just starting out with Salesforce? Are you an admin looking to get into development? Join us to learn a few easy,…

    salesforce training videos for beginners, Salesforce Developer, Salesforce Beginner Tutorial, Salesforce Tutorial for Beginners, Salesforce Lightning
    Shiv Kumar Sharma Feb 8, 2018
    2,104  Views
    Add Sound Effects to Your Salesforce Org | Salesforce Tutorials | #SalesforceBolt

    Add Sound Effects to Your Salesforce Org | Salesforce Tutorials | #SalesforceBolt

    Video in Salesforce Development

    In this video you will learn to Use a Lightning Web Component to play a fun sound when a big deal closes. You can play…

    Salesforce Tutorial, Salesforce Development, Salesforce Developer, Salesforce Lightning, salesforce
    Kapil Jun 15, 2020
    4,927  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.