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: Entry Level Jobs Description for Salesforce Developer & Admin
- Private:- method and variable only we can access in the defining apex class
- Public:- method and variable of an apex class we can access from another apex class as well.
- 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.
- Global :- method and variable can be access from any apex class in the organization or from any other organization.
Static and Instant Method:-
Apex code:-
Read: Salesforce Lightning Tutorial For Beginners
- 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>();
}
}
GO TO ANONYMOUS WINDOW.
Call the class.

Read: What Apex Email in Salesforce?
FaceBook
Twitter
Google+
LinkedIn
Pinterest
Email
Salesforce Course
Upcoming Batches
Trending Courses
AWS
- AWS & Fundamentals of Linux
- Amazon Simple Storage Service
- Elastic Compute Cloud
- Databases Overview & Amazon Route 53
Upcoming Class
0 day 29 Sep 2023
DevOps
- Intro to DevOps
- GIT and Maven
- Jenkins & Ansible
- Docker and Cloud Computing
Upcoming Class
7 days 06 Oct 2023
Data Science
- Data Science Introduction
- Hadoop and Spark Overview
- Python & Intro to R Programming
- Machine Learning
Upcoming Class
0 day 29 Sep 2023
Hadoop
- Architecture, HDFS & MapReduce
- Unix Shell & Apache Pig Installation
- HIVE Installation & User-Defined Functions
- SQOOP & Hbase Installation
Upcoming Class
0 day 29 Sep 2023
Salesforce
- Salesforce Configuration Introduction
- Security & Automation Process
- Sales & Service Cloud
- Apex Programming, SOQL & SOSL
Upcoming Class
1 day 30 Sep 2023
QA
- Introduction and Software Testing
- Software Test Life Cycle
- Automation Testing and API Testing
- Selenium framework development using Testing
Upcoming Class
0 day 29 Sep 2023
Business Analyst
- BA & Stakeholders Overview
- BPMN, Requirement Elicitation
- BA Tools & Design Documents
- Enterprise Analysis, Agile & Scrum
Upcoming Class
0 day 29 Sep 2023
MS SQL Server
- Introduction & Database Query
- Programming, Indexes & System Functions
- SSIS Package Development Procedures
- SSRS Report Design
Upcoming Class
7 days 06 Oct 2023
Python
- Features of Python
- Python Editors and IDEs
- Data types and Variables
- Python File Operation
Upcoming Class
0 day 29 Sep 2023
Artificial Intelligence
- Components of AI
- Categories of Machine Learning
- Recurrent Neural Networks
- Recurrent Neural Networks
Upcoming Class
0 day 29 Sep 2023
Machine Learning
- Introduction to Machine Learning & Python
- Machine Learning: Supervised Learning
- Machine Learning: Unsupervised Learning
Upcoming Class
35 days 03 Nov 2023
Tableau
- Introduction to Tableau Desktop
- Data Transformation Methods
- Configuring tableau server
- Integration with R & Hadoop
Upcoming Class
0 day 29 Sep 2023
Salesforce Course
Upcoming Batches
Receive Latest Materials and Offers on Salesforce Course