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

    How To Enhance Your Value As A Salesforce Admin

    Who Ya Gonna Call – ‘No Longer Your IT Team’ - (How To Enhance Your Value As A Salesforce Admin!)

    Blog in Salesforce Products

    Telephony has forever and a day been a dark art , thrust into the hands of the IT Department who typically do not have the…

    CRM System, Interactive Voice Response, IVR, Natterbox, PBX System
    Ian Oct 11, 2017
    6,674  Views
    Profiles in Salesforce

    Users and Profiles in Salesforce - Learn All About It

    Blog in Salesforce

    Users Who is a User in Salesforce?  A user is anyone who logs into the Salesforce platform or we can simply say anyone who has…

    App Builders, App Managers, Custom Profile, Employees, Organization
    Mohit Kumar Aug 31, 2022
    4,457  Views
    schema builder

    Salesforce Schema Builder - Everything You Need to Know

    Blog in Lightning, Others

    Schema Builder:- Schema Builder in Salesforce gives details just like the field values, required fields, and how objects are associated by showing search and master-detail…

    API Access, Custom Fields, custom object, Lightning Experience, Salesforce
    Ratnesh Apr 15, 2020
    18,206  Views

    Popular Salesforce Videos

    How to Take Your Salesforce Support Model to the Next Level

    How to Take Your Salesforce Support Model to the Next Level

    Video in Salesforce Stories

    Jeremy Muldoon, the Salesforce expert at Rimini Street, discusses the Salesforce resource challenges faced by businesses today, how to overcome them, and how to take…

    Salesforce Training, Salesforce Tutorial, salesforce, salesforce platform, Salesforce Video
    Nauman Feb 11, 2022
    1,970  Views
    Salesforce SOAP API integration using Partner WSDL

    Salesforce SOAP API integration using Partner WSDL

    Video in Salesforce Integration

    This video is another one on our Salesforce Integration learning video series, through this video our experts will be going to demonstrate how to use…

    Salesforce Development, SOAP, Salesforce Integration, Apex SOAP API, Salesforce Apex Code
    Pooja Apr 14, 2018
    2,586  Views
    How to Find More Prospects, Win More Deals, and Keep Customer Happy with Salesforce Essentials

    How to Find More Prospects, Win More Deals, and Keep Customer Happy with Salesforce Essentials

    Video in Salesforce Stories

    Watch this video to learn how to minimize busy work and empower your sales and support teams to spend more time closing deals and engaging…

    salesforce, Salesforce Video, Salesforce Essentials, Happy Customers, Customer Information
    Rupal Kakkar Apr 15, 2020
    1,493  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.