Month End Offerl : Get 30% OFF + $999 Study Material FREE - SCHEDULE CALL

- Salesforce Blogs -

An Introduction to Apex Class in Salesforce for Beginners

Introduction to Apex class:-

Salesforce has already provided prebuilt application such as workflow, approval process, process builder etc for the CRM functionality. It may be possible that the Organization has much more complex business requirements which cannot achieve by current prebuilt applications. When it happensthe Force.com platforms has following ways for developer to build custom functionality. We Can use Apex for Web Services, Email Services, Provide solution for  Complex business requirements which cannot  fulfilled by workflow rule. Add custom logic to another operation such as saving record.

How to Write Basics Access modifier:-

Read: Know Everything About a Salesforce Consultant Roles and Responsibilities!
  1. Private:- method and variable only we can access in the defining apex class
  2. Public:- method and variable of an apex class we can access from another apex class as well.
  3. Protected:- method and variable can be access by any inner classes in the same Apex class, and those classes that extend the defining Apex class. You can only use this access modifier for instance methods and member variables.
  4. Global :- method and variable can be access from any apex class in the organization or from any other organization.

free salesforce demo Static and Instant Method:-

Apex code:-

Read: Interview With Eric Dreshfield
  1. How to get list of records using apex class

Ans:-


Public class listofAccountRecordClass
{
Public list<account>getAccountList(){

List<account>accountList = [select id,name,phone,industry,rating from account];
If(!accountList.isEmpty()){
	returnaccountList;
}
System.debug(‘accountList’+accountList);
return new list<Account>();
}
}

An Introduction to Apex Class in Salesforce for Beginners An Introduction to Apex Class in Salesforce for Beginners GO TO ANONYMOUS WINDOW. An Introduction to Apex Class in Salesforce for Beginners Call the class. An Introduction to Apex Class in Salesforce for Beginners An Introduction to Apex Class in Salesforce for Beginners

Read: The Ideal Salesforce Admin Tutorial For Beginners With Career Path & Certifications


fbicons FaceBook twitterTwitter lingedinLinkedIn pinterest Pinterest emailEmail

     Logo

    JanBask Training Team

    The JanBask Training Team includes certified professionals and expert writers dedicated to helping learners navigate their career journeys in QA, Cybersecurity, Salesforce, and more. Each article is carefully researched and reviewed to ensure quality and relevance.


Comments

Trending Courses

Gen AI Course

Gen AI

  • Introduction to Generative Models
  • Generative Adversarial Networks (GANs)
  • The Art and Science of Prompt Engineering
  • MLOps: Deploying Generative AI Models
Gen AI Course

Upcoming Class

11 days 14 Jul 2026

Agentic AI Course

Agentic AI

  • Introduction to Agentic AI
  • Multi-Agent Setup with LangGraph Context Handling in Graphs
  • Performance Benchmarking Advanced Prompt Engineering for Agents
  • Agent Behavior Tuning Project and Mock Session
Agentic AI Course

Upcoming Class

7 days 10 Jul 2026

AI in Automation Testing Course

AI in Automation Testing

  • Intro to AI & ML in Automation
  • Playwright + JS (JavaScript) + API Tesng
  • Automaon with Using ChatGPT & Playwright MCP server
  • GitHub Copilot, AI Tools & Interview preparation
AI in Automation Testing Course

Upcoming Class

0 day 03 Jul 2026

Cyber Security Course

Cyber Security

  • Introduction to cybersecurity
  • Cryptography and Secure Communication 
  • Cloud Computing Architectural Framework
  • Security Architectures and Models
Cyber Security Course

Upcoming Class

0 day 03 Jul 2026

Data Science Course

Data Science

  • Data Science Introduction
  • Hadoop and Spark Overview
  • Python & Intro to R Programming
  • Machine Learning
Data Science Course

Upcoming Class

1 day 04 Jul 2026

QA Course

QA

  • Introduction and Software Testing
  • Software Test Life Cycle
  • Automation Testing and API Testing
  • Selenium framework development using Testing
QA Course

Upcoming Class

-1 day 02 Jul 2026

Salesforce Service Cloud Course

Salesforce Service Cloud

  • Industry Knowledge Introduction
  • Adoption and Maintenance
  • Interaction Channels Introduction
  • Integration and Data Management
Salesforce Service Cloud Course

Upcoming Class

0 day 03 Jul 2026

AWS Course

AWS

  • AWS & Fundamentals of Linux
  • Amazon Simple Storage Service
  • Elastic Compute Cloud
  • Databases Overview & Amazon Route 53
AWS Course

Upcoming Class

-1 day 02 Jul 2026

Search Posts

Reset

Receive Latest Materials and Offers on Salesforce Course

Interviews