Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 2

1)Tell me about your self?

2)Tell me about yout last project?

3)What are the Methods we should Implement in Batch apex?


start() : It collects the records or objects to pass to the interface method
execute()
execute() : To do the required processing of each chunk of data, use the execute
method. ...
finish() :

4)What is a Database.QueryLocator?
In Salesforce, Database.QueryLocator is an interface used in batch Apex to provide
a mechanism for iterating over a large set of records without loading them all into
memory at once

5)What is the Difference between Synchronous and Asynchronous?


In Salesforce, the terms synchronous and asynchronous refer to different ways of
executing code and interacting with the platform. Here's a breakdown of their
differences:
Syncronous:
Execution: Code is executed in a single thread. This means that the code must
complete before the next line of code can be executed.
User experience: The user interface is blocked while the code is running. This
means that the user cannot interact with the system until the code has finished.
Examples: Trigger execution, DML operations (e.g., create, update, delete),
validation rules, workflow rules.
Advantages: Simple to understand and implement, good for short-running tasks.
Disadvantages: Can block the user interface, can hit governor limits for long-
running tasks
Asynchronous:
Execution: Code is executed in a separate thread from the main user interface
thread. This means that the user interface is not blocked while the code is
running.

6)Database.Stateful:
Maintains state: Batch jobs with this annotation retain information across
transactions within the same job.

7)Types of Flows explain the scenario that you have worked in the recent projeact?

8)Have worked on the Lwc?


@api,@wire@track

9)how to you call the apex class in the LWC?

10)Can we call the lwc componet in the Flow?

11)What is Order of execution in salesforce?

12)Governor LIMITS?

13)Best partices of the Trigger?

14) what is difference between Queueable Apex and future APEX


future
======
1. Future will never use to work on SObjects or object types.
2. When using the future method we cannot monitor the jobs which are in process.
3. The future method cannot be called inside the future or batch class.
4. The future method will never be queued.

Queueable
========
1. Queueable Jobs can contain the member variable as SObjects or custom Apex Types.
2. When using queueable jobs it will make the AsyncApexJob which we can monitor
like Scheduled jobs.
3. Queueable Apex can be called from the future and batch class.
4. Using Queueable Apex will chain up to queueable jobs and in Developer Edition it
is only 5 Jobs.

15)Whenevery the phone field on the account object is updated the list of contact
should aslo update with the same number in salesforce trigger
trigger testTrigger on Account (after update) {
// List to hold updated contacts
List<Contact> updatedContacts = new List<Contact>();

// Iterate through the Trigger.new list of updated Accounts


for(Account acc : Trigger.new) {
// Check if the Phone field has been changed
if(acc.Phone != Trigger.oldMap.get(acc.Id).Phone) {
// If the Phone field is updated, find related contacts and update
their phone numbers
List<Contact> relatedContacts = [SELECT Id, Phone FROM Contact WHERE
AccountId = :acc.Id];

for(Contact con : relatedContacts) {


// Update the Phone field of the contact with the new Account Phone
con.Phone = acc.Phone;
updatedContacts.add(con);
}
}
}

// Update the list of contacts with the new phone numbers


if(!updatedContacts.isEmpty()) {
update updatedContacts;
}
}

You might also like