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 › How to typecast a list of Salesforce sObjects into list of Accounts?

    Tagged: Account, List, Salesforce Customization, Salesforce Development, Salesforce sObject

    • Salesforce® Discussions

      How to typecast a list of Salesforce sObjects into list of Accounts?

      Posted by Kumar on December 8, 2016 at 7:29 AM

      Hi everyone,

      I have a list of type sObject, and I want to typecast it into a list of Accounts, i.e.

      list<sObject> into list<Account>

      How do I implement this?

      Thanks in advance.

       

      • This discussion was modified 9 years, 1 month ago by  Kumar.
      • This discussion was modified 9 years, 1 month ago by  Forcetalks.
      • This discussion was modified 9 years, 1 month ago by  Forcetalks.
      Kumar replied 9 years, 1 month ago 2 Members · 2 Replies
      • Account
      • List
      • Salesforce Customization
      • Salesforce Development
      • Salesforce sObject
    • 2 Replies
    • sushant

      Member
      December 8, 2016 at 11:19 AM

      Hi kumar,

      Suppose we have a list<sobject> named as l1 then we can use this kind of syntax (list<Account> l1) tp type cast it.i have type cast sobject list to Account list in this syntax.

      Hope this helps you

      Thanks

    • Kumar

      Member
      December 8, 2016 at 11:29 AM

      Thanks dude

    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

    Debug Mode and Component Caching

    Choosing Debug Mode and Component Caching to build Lightning Components rapidly and efficiently

    Blog in Lightning

    As you start developing Lightning Components you must take care of a few settings in Salesforce Org, depending on whether you are in production or…

    Browser Caching, caching, component caching, CSS, debug mode
    Rajat Oct 16, 2018
    3,526  Views
    Learn All About the Apex Core Concepts in 2023

    Learn All About the Apex Core Concepts in 2023

    Blog in Salesforce Apex

    Apex code typically contains many things that you might be familiar with from other programming languages. Programming elements in Apex This Image will describe the…

    APEX Programming Language, Apex SOAP API, Apex Tests, Apex Trigger, Apex Triggers
    SF Jan 10, 2023
    2,044  Views

    Salesforce Sales Cloud: Implementation and Adjusting, Customization

    Blog in Salesforce customization

    What to do if you implement a costly CRM, and find out it cannot cover all your business processes? If you are a business owner…

    Appearance, approach, Approaches, Automation, Average
    Sparkybit Aug 7, 2023
    1,468  Views

    Popular Salesforce Videos

    What is Salesforce Hyperforce?

    What is Salesforce Hyperforce?

    Video in Salesforce Products

    In this video, you will take a look at Salesforce Hyperforce, Salesforce's new re-architecting of the Salesforce platform. 00:00 Introduction 00:28 What is Salesforce Hyperforce?…

    Salesforce Training, dreamforce, salesforce, salesforce platform, Salesforce Org
    Pooja Jun 9, 2021
    2,617  Views
    Salesforce Platform Quick Tip: How to Use Einstein Search

    Salesforce Platform Quick Tip: How to Use Einstein Search

    Video in Salesforce Training

    Want to improve your searches in Salesforce, and make them faster and more intuitive? In part one of this 2 part series, Trailblazer and Salesforce…

    Salesforce Training, Salesforce Tutorial, Salesforce Administrator, salesforce platform, Salesforce Einstein
    Prafull Oct 22, 2021
    1,779  Views
    PASS Salesforce Certified Administrator Exam on the FIRST Attempt

    PASS Salesforce Certified Administrator Exam on the FIRST Attempt

    Video in Salesforce Certifications

    Want to pass the Salesforce Certified Administrator Exam on the FIRST Attempt? Then this video is for you. Here are the steps: STEP 1 :…

    Salesforce Certifications, Salesforce Administrator Training, Salesforce Beginner Tutorial, Salesforce Administrator, Certified Salesforce Admin
    Prafull Dec 27, 2018
    1,942  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.