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, 4 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, 4 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

    Email Relay in Salesforce

    How to Setup Email Relay in Salesforce - Learn Here

    Blog in Salesforce Admin

    In this blog, we got to know How to setup Email Relay in Salesforce. Reviewing the Current Setup of our Salesforce ORG Login in your…

    Configure Button, Email, Email Domain Filter, Email Relay, Email Relay Connection
    shreya yadav Jul 13, 2022
    10,296  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,394  Views
    Salesforce Administrator Resume

    A Guide To Writing Your Salesforce Administrator Resume

    Blog in Salesforce Career

    A Salesforce Administrator ensures companies experience the full potential of Salesforce and its technology. With an average starting annual salary of $79,000 and a 400% growth…

    Certifications, Certified Salesforce Administrator, Customer Service Teams, Education, End-user Support
    Emily Henry Sep 7, 2021
    4,097  Views

    Popular Salesforce Videos

    How to Get a Mentor? | Salesforce Learning | The Shrey Sharma Show

    How to Get a Mentor? | Salesforce Learning | The Shrey Sharma Show

    Video in Salesforce Training

    Looking for a mentor for Salesforce Learning? Watch this video to learn how to find one. Watch the full Video: https://youtu.be/6oi2zdJCFhs Check out the book:…

    Salesforce Training, Salesforce Jobs, salesforce, Salesforce Video, Salesforce Learning
    S2 May 12, 2022
    1,611  Views
    Salesforce - Sage ERP Integration

    Salesforce - Sage ERP Integration

    Video in Salesforce Integration

    Salesforce Integration with Sage ERP (SageX3 / Sage100 / Sage300) delivers seamless, real-time, bi-directional integration that plays a pivotal role in unlocking the potential of…

    Salesforce Training, Salesforce Tutorial, Salesforce Integration, salesforce, Salesforce Video
    Greytrix Dec 28, 2020
    2,591  Views
    How To Become A Salesforce Administrator | Salesforce Administrator Training

    How To Become A Salesforce Administrator | Salesforce Administrator Training

    Video in Salesforce Training, Salesforce Development

    What does Salesforce developer do? Salesforce developers lead the testing and implementation of software development efforts, including coding, configuration, maintenance, installation, testing, and debugging, as…

    Salesforce Training, Salesforce Developer, Learn Salesforce, Salesforce Video, Testing
    Rupal Kakkar Jul 29, 2021
    2,054  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.