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 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 Integration with ChatGPT

    Blog in Salesforce integration

    Hey Guys, today we are discussing Salesforce Integration with ChatGPT (which is a product of openAI). Everyone is aware of ChatGPT which thrived and gained…

    Barcodes, Benefits, Beta, Components, Contacts
    Kizzy Consulting Sep 4, 2023
    2,983  Views
    Advertising Studio in Salesforce Marketing Cloud

    Advertising Studio in Marketing cloud

    Blog in Salesforce Cloud Platform, Salesforce Products

    Advertising Studio - Advertising Studio allows businesses to advertise on a one-to-one level, automating the transfer process from email to paid media to ensure your…

    Marketing Cloud Advertising and Data Products, Salesforce Marketing Cloud, Salesforce Products
    Rajan Mar 28, 2018
    7,597  Views
    salesforce commerce cloud

    Salesforce Commerce Cloud To Join Hands With Facebook Dynamic Ads

    Blog in Salesforce Cloud Platform

    This season makes it possible for brands to leverage Salesforce Commerce Cloud and Facebook in fresh ways to deliver product information and drive conversion on…

    Cloud Pages, Commerce Cloud Integration with Facebook, Commerce Cloud Platform, Commerce Platform, Consumers
    Algoworks Mar 26, 2017
    6,053  Views

    Popular Salesforce Videos

    How to Use Salesforce Process Builder 2017

    How to Use Salesforce Process Builder 2017

    Video in Salesforce Training

    Salesforce process builder is a powerful tool you can use to automate business processes. It has a simple interface that allows you to point and…

    Salesforce Tutorial, Salesforce Administration, Salesforce Admin Training, Salesforce Developer, Salesforce Beginner Tutorial
    Abhay Jan 8, 2018
    1,787  Views
    Use Case Hierarchy to Link Cases in Salesforce

    Use Case Hierarchy to Link Cases in Salesforce

    Video in Salesforce Stories

    Want to link your cases, so you and your team have a complete view of what’s going on with a customer? Do you want to…

    Salesforce Training, Salesforce Tutorial, salesforce, Salesforce Video, Service Cloud
    Abhishek Mar 7, 2022
    3,008  Views
    Is Trailhead enough to crack Salesforce Interview?

    Is Trailhead enough to crack Salesforce Interview?

    Video in Salesforce Certifications

    In this video, Shrey answered one of the most asked questions related to Salesforce Interview. Let's see how beautifully Shrey answered this Question. We hope…

    Salesforce Training, Salesforce Jobs, Salesforce Certification, salesforce, Trailhead
    Jogender Apr 14, 2021
    1,649  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.