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 check whether an ArrayList is empty or not in Apex in Salesforce?

    Tagged: AccountNumber FROM Account]; if(records!=null && !records.isEmpty()) { for(Account record: records) { // Do Something Here } }

    • Salesforce® Discussions

      How to check whether an ArrayList is empty or not in Apex in Salesforce?

      Posted by Anjali on May 5, 2020 at 12:41 PM

      How to check whether an ArrayList is empty or not in Apex in Salesforce?

      Marziya replied 5 years, 10 months ago 4 Members · 3 Replies
      • AccountNumber FROM Account]; if(records!=null && !records.isEmpty()) { for(Account record: records) { // Do Something Here } }
    • 3 Replies
    • Kirandeep

      Member
      May 5, 2020 at 4:01 PM

      Another way to check if arraylist contains any element or not, we can check the size of arraylist. If the list size is greater than zero, then list is not empty. If list size is 0, list is empty. If we look inside the isEmpty() method, it also check the size of arraylist to determine if the list is empty or not

    • Ayush

      Member
      May 6, 2020 at 10:20 AM

      the isEmpty() method, it check the size of arraylist to determine if the list is empty or not

    • Marziya

      Member
      May 6, 2020 at 1:34 PM

      How to check whether an ArrayList is empty or not in Apex in Salesforce?

      • This reply was modified 5 years, 10 months ago by  Marziya.

    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

    How to Solve Sales & Marketing Misalignment Using Sales Cloud Features

    Blog in Salesforce Cloud Platform

    Sales and marketing misalignment remains a major challenge for growing businesses. Recent data shows that only about 23% of sales professionals say their company’s sales…

    Cloud Software, marketing, SALES, Sales Cloud, Salesforce Sales Cloud
    William Feb 2, 2026
    637  Views

    What is Salesforce Agentforce? A Guide to Features, Benefits and Technology

    Blog in Salesforce integration

    AgentForce is an AI agent builder powered by Salesforce, designed for companies seeking innovation in support, with a strong focus on employee and customer assistance.…

    bespoke Salesforce Development Services, Certified Salesforce Consulting Company, Custom Salesforce Development, data and AI-generated, Salesforce Agentforce
    AwsQuality Aug 1, 2025
    271  Views
    Inbound web services

    Inbound and Outbound Web Services in Salesforce

    Blog in Others, Salesforce

    Introduction to Inbound web Service It's associate degree inbound call to Salesforce, however outward-bound call to the external system. Here, the external system is the…

    AWS, Chatter Extension, HyperText Transfer Protocol, Inbound Web Services, Internet Services
    Ratnesh Jul 10, 2020
    17,216  Views

    Popular Salesforce Videos

    Get a Salesforce Developer Job in 5 Steps | For Freshers | For Admins | For Non-SFDC People

    Get a Salesforce Developer Job in 5 Steps | For Freshers | For Admins | For Non-SFDC People

    Video in Salesforce Training, Salesforce Admin

    In this video, We will be talking about some tips to get your first job as a Salesforce Developer. If you are a recent graduate,…

    Salesforce Training, Salesforce Jobs, salesforce, Salesforce Admins, Salesforce Developers
    Pooja May 1, 2020
    1,836  Views
    How to Crack Salesforce Platform Developer I Exam in 2021?

    How to Crack Salesforce Platform Developer I Exam in 2021?

    Video in Salesforce Certifications

    Salesforce Platform Developer I Certification Training ensures that you master the concepts and components of application development on the Salesforce platform. Watch this video and…

    Salesforce Training, Salesforce Certification, Salesforce Developer, salesforce platform, Salesforce Video
    Neha Yadav May 6, 2021
    3,288  Views
    Algoworks Is Now A Salesforce Summit (Platinum) Partner | Salesforce Consulting Services

    Algoworks Is Now A Salesforce Summit (Platinum) Partner | Salesforce Consulting Services

    Video in Salesforce Consultant

    It's been just a year since we became Salesforce gold consulting partners. Algoworks has now been recognized as a Salesforce Summit Partner (also known as…

    Salesforce Training, Salesforce Tutorial, salesforce, salesforce consulting services, Salesforce Video
    Algoworks May 10, 2022
    1,459  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.