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 › 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, 8 months ago by  Kumar.
      • This discussion was modified 9 years, 8 months ago by  Forcetalks.
      • This discussion was modified 9 years, 8 months ago by  Forcetalks.
      Kumar replied 9 years, 8 months 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

    • [adinserter block='9']
    • 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

    Popular Salesforce Blogs

    Asynchronous Apex

    Blog in Salesforce Apex

    Asynchronous Apex is used to run a process in a Separate thread when the are resources available.There is no SLA for these jobs as the…

    API Limits, Asynchronous Apex, Asynchronous SOQL, Batch Apex, Future Annotation
    SFDC Tips Feb 11, 2019
    28,233  Views

    A Deep Dive into AbstraLinx's Integration with ChatGPT's Generative AI

    Blog in Salesforce Tools

    Hello Salesforce enthusiasts! Today, we are discussing the release of the new update for AbstraLinx by Softbuilder. This new release brings a whole new dimension…

    API requests, Auto-Generated Content, Auto-Generated Descriptions, ChatGPT Integration, Data Glossaries
    John Oct 18, 2023
    1,704  Views
    Salesforce Governor Limits Cheatsheet

    Salesforce Governor Limits - Cheatsheet

    Blog in Salesforce Tutorial

    Salesforce a CRM  has there own limitation on the usage of resources which are actually based upon separate editions and these editions have there own governor…

    Cheatsheet, Salesforce Developer Edition, Salesforce Editions, Salesforce Enterprise Edition, Salesforce governor limits
    Archit Mar 29, 2018
    28,329  Views

    Popular Salesforce Videos

    Salesforce: Advanced 'Change Owner' Control in Flow and Apex

    Salesforce: Advanced 'Change Owner' Control in Flow and Apex

    Video in Salesforce Workflow

    Alex Edelstein explains the Salesforce feature known as the 'Change Owner' Control in Flow and Apex. This video is geared toward those already familiar with…

    Salesforce Training, Salesforce Tutorial, Salesforce Apex, salesforce, Apex
    Mayra Oct 21, 2022
    2,310  Views
    Salesforce Object Search Language: What is SOSL and when to use SOSL?

    Salesforce Object Search Language: What is SOSL and when to use SOSL?

    Video in Salesforce Apex

    When to Use SOSL? Use SOSL when you don’t know which object or field the data resides in, and you want to: Retrieve data for…

    Salesforce Visualforce, Salesforce Developer, Salesforce Rest API, Apex APIs, Apex SOAP API
    Victoria Nov 23, 2018
    2,222  Views
    How to Get a Job in Salesforce as a Fresher | Video Guide

    How to Get a Job in Salesforce as a Fresher | Video Guide

    Video in Salesforce Training, Salesforce Admin

    Looking to start a career in Salesforce. Wondering how to get a job in Salesforce as a fresher. Check out this video it will guide…

    Salesforce Training, Salesforce Tutorial, Salesforce Jobs, salesforce, Salesforce Video
    Apex Dec 13, 2022
    1,883  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.