1st level Salesforce Development Prepartion
1st level Salesforce Development Prepartion
Apex Class -
public class BankAccount {
// Variables
Decimal balance = 5000;
// Default Constructor
public BankAccount() {
// Logic
}
// Methods
public Decimal deposit(Integer amount) {
balance += amount;
return balance;
}
* Constructor executs only one time when the object is created. If you want to call
the logic again and again use method.
* Object -
ClassName objectName = new ConstructorName();
BankAccount bankAcc = new BankAccount();
BankAccount bankAcc2 = new BankAccount(500.50);
// It executs only one time, the purpose is for the post commit logic
public void finish(Database.BatachableContext bc) {
// Sending email / tracking errors
}
}
* Types of Visualforce controllers -
1. Standard Controller -
<apex:page standardController="ObjectApiName"></apex:apex>
2. Custom Controller -
<apex:page controller="ApexClassName"></apex:apex>
* How to achieve the pagination in visualforce -
1. ApexPages.StandardSetController
2. Using Limit and Offset in the SOQL query
* What is wrapper class ?
To wrap multiple data types information together within a class and use the
class to show as a table or record on the UI
Example:
1. To hold check box value and record together and dispaly as a table
2. To hold different records info in the class and show as a table
* Types of Ajax Functions ?
1. actionStatus
2. actionSupport
3. actionFunciton
4. actionPoller
5. actionRegion
* What is Visualforce Component?
* To make the visualforce logic reusable we use visualforce component.
---
* Why to create test class and what is the min code coverage required?
* To do unit testing how the main class works and min over all code coverage
for the organization should be >= 75% (which is required while deploying to the
production)
---
* Types of integration -
1. SOAP API : WSDL file is used to peform integeration. XML is used for the
data exchange.
2. REST API : Endpoint url of the api is used for the integration. JSON/XML is
used for the data exchange
---
* Different ways of deployment?
1. Change Sets
2. VS Code
3. Force.com Migration Tool (Ant Tool)
---
* What Aura component ?
* It is a framework to develop the UI. When we create Aura component it creates
bundle with the following files -
Sample.cmp --> UI
SampleController.js --> client side logic (Only specific to current
component)
SampleHelper.js --> client side logic (It can be reusable)
Sample.css --> (To apply styles)
Sample.design --> (To provide configurable options in the app builder)
Sample.auradoc --> (To show the component in the component library
documentation)
SampleRenderer.js --> (To override standard events logic)
Sample.svg --> (To change the icon of the component which display in app
builder)
* It is faster when compare to visualforce and it is app centric
---
* What is LWC ?
* It is introduced in 2019, it is faster when compared to aura by taking the
advanage of the modren webstack.
(Webstack: the latest features (HTML, JavaScirpt, CSS) supporeted by the
browsers)
* When you create LWC you see the following files in bundle -
1. html --> template (UI logic)
2. js --> client side logic and to call apex logic
3. xml --> used to expose the lwc (to show in app builder or use as tab or
quick action)
---