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 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 6 years, 5 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

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

    Popular Salesforce Blogs

    SMS In Salesforce

    3 Best SMS API Providers Other Than Twilio For SMS In Salesforce

    Blog in Others, Salesforce

    Every business strives for quick and scalable communication within a few minutes. And this is obviously not possible with calls and emails. This is why…

    AppExcahge, Automate Interactions, Automated Interactions, Best SMS API, Bulk Messaging
    360 SMS APP Jun 28, 2021
    5,022  Views
    Why Revenue Teams Struggle Without End-to-End Sales Visibility

    Why Revenue Teams Struggle Without End-to-End Sales Visibility

    Blog in Sales

    Modern revenue organizations generate immense volumes of customer and pipeline data every day. However, many enterprises still find it difficult to convert this data into…

    Shivam Jun 11, 2026
    690  Views
    Triggers in Salesforce

    Triggers in Salesforce - Get Started

    Blog in Salesforce Apex

    What is a Trigger? A Trigger is an Apex script, which we can use in many situations. The use of trigger is, it will help…

    Apex Script, Apex Triggers, Before Triggers, Code, Code is Executed
    Romil Oct 22, 2021
    3,813  Views

    Popular Salesforce Videos

    Create Custom App in Salesforce | Salesforce Custom App | Salesforce Tutorial

    Create Custom App in Salesforce | Salesforce Custom App | Salesforce Tutorial

    Video in Salesforce Training, Salesforce Apps

    Watch this amazing video to learn how to create a custom app in Salesforce. Salesforce is a cloud-based platform that has transformed how companies have…

    Salesforce Training, Salesforce Tutorial, salesforce, Learn Salesforce, Salesforce Video
    Pooja Nov 13, 2020
    2,384  Views
    9 Stages of Identity & Access Management Lifecycle | Salesforce Tutorial

    9 Stages of Identity & Access Management Lifecycle | Salesforce Tutorial

    Video in Salesforce Certifications

    Grow your architect skills and expertise in the area of Identity and Access Management. This video explains the 9 stages of Identity & Access Management…

    Salesforce Training, Salesforce Tutorial, Salesforce Video, Salesforce Learning, Salesforce Architect
    Abhishek Jul 16, 2021
    2,119  Views
    Setting Up Service Territories and Operating Hours | Salesforce Webinar

    Setting Up Service Territories and Operating Hours | Salesforce Webinar

    Video in Others

    Scale your business and ensure optimized performance by setting up service territories in Salesforce Field Service. In Salesforce Field Service, operating hours represent service territory…

    salesforce, Salesforce Webinar, Salesforce Video, Salesforce Field Service
    AblyPro Jul 2, 2024
    1,234  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.