ForceLearn

Dev

Sharing is caring!

salesforce interview question and answers

Q. What is workflow ?
A. It is automated process that fired an action based on evalution criteria and rule cretria and Path : Setup Create Workflow & Approval process
Q. What is trigger ?
A. It is a piece of code that executes before and after a record is inserted or updated.we can use 20 DML operations in one trigger
Q. What is Wrapper class ?
A. It is a class whose instance are collections of other objects.It is used to display different object on visualforce pages in same table
Q. What is static resources ?
A. Static resources is used to upload images, zip files, jar files, JavaScript, Css and it is refered to visual force pages.
Q. What is difference between Output Text and Output Field ?
A. Output Text always display field value as text irresponsive of datatypes such as currency, lookup ..etc and Output Field is display automatically according to fields datatypes, if it currency looks currency symbol, if it is lookup type then display as link in pages.
Q. What is difference between Input text and Input field ?
A. Always display field value as text box irrespective of datatypes.Display automatically according to fields data types
Q. What is difference between datatable and Pageblocktable ?
A. Datatable is used to display records withoutout standrad salesforce look and feel and Pageblocktable is used to display records with standrad salesforce look and feel
Q. Can we change of class/ trigger in production environment ?
A. No , we cant change class and trigger in production.we can change visualforce pages in production but page does not have custom controller
Q. What is salescloud ?
A. Sales Cloud refers to the sales module in salesforce.com. It includes Leads, Accounts, Contacts, Contracts, Opportunities, Products, Pricebooks, Quotes, and Campaigns.
Q. What is service cloud ?
A. Service Cloud refers to the service module in salesforce.com. It includes Accounts, Contacts, Cases, and Solutions.
Q. Can we change custom financial year to standard fiscal year once it is changed by administrator ?
A. No, We cannot
Q. What is page layout and Compact layout?
A. Page Layout is used for web application and Compact Layout is used for Mobile applications
Q. How many ways we can share a record ?
A. Role hierachy, OWD (Organization Wide Default), Manual Sharing, Criteria based sharing rules and apex sharing.
Q. What is IsBlank and IsNull ?
A. IsNull is support only numbers. IsBlank is support both text and number
Q. What is trigger.new and trigger.old ?
A. Trigger.new returns a list of new version of sObjects records. This Sobjects is only avaliable insert & update and records only modifed in before triggers
Q. What is Trigger.NewMap and Trigger.OldMap ?
A. Trigger.NewMap is map of new ID versions and Trigger.OldMap is map of old ID versions
Q. Why do we write test class?
A. To test write class functionality is working or not by using test class. Salesforce does not allow deployment in production if test coverage is less than 75.
Q. What is Future Annotation ?
A. By using Future Annotation, we can find methods are running asynchronously
Q. How to write custom error in trigger ?
A. By using addError()
Q. What are methods in batch apex ?
A. Start , Execute and Finish methods
Q. Can we lock records in apex ?
A. Yes, we can lock records in apex using for update
Q. What is visualforce Component ?
A. Visualforce Component is a piece of code that can be reused and encapsulated in other vf pages
Q. How to make field as required in visualforce pages ?
A. By Making Field as required on visualforce page marking as required is equal to true
Q. Can user change his own profile and role ?
A. User can change his role but he cannot change his profile
Q. Can we deliver visualforce page in excel format ?
A. Yes we can convert visualforce into excel format by using content type
Q. How many types of email templates in salesforce ?
A. Text,HTML (Using letterhead ),Custom (Using without Letter head) and Visualforce Page
Q. What is Rollup Summary ?
A. Rollup Summary is used to display the count of child records and calculate the sum,minimum and maximum of child records.
Q. What is Audit trail ?
A. Audit Trail provides the information or track all the recent setup changes that an administrator done to organization.It stores the last 6 months data.
Q. What is OWD ?
A. It defines the basic level of access to data records for all users in organization. It helps to restrict access into data.They are Private,Pubilc Read/write,Public Read/write/Transfer,Controlled by Parent,Public read only
Q. What are folders in salesforce ?
A. Folders are used to store organization email templates, documents, reports and dashboards
Q. Why use triggers in Salesforce?
A. Apex can be invoked by using triggers . Apex triggers enable you to perform custom actions before or after changes to Salesforce records, such as insertions, updates, or deletions. A trigger is Apex code that executes before or after the following types of operations: insert.
Q. What programming language is Salesforce written in?
A. Apex is a proprietary programming language provided by the Force.com platform to developers similar to Java and C#. It is a strongly typed, object-oriented, case-insensitive programming language, following a dot-notation and curly-brackets syntax.
Q. What is difference between workflow and trigger in Salesforce?
A. Workflow is automated process that fired an action based on Evaluation criteria and rule criteria. We can access a workflow across the object. Trigger is a piece of code that executes before or after a record is inserted or updated. We can use 20 DML operations in one trigger.
Q. How many types of triggers are there in Salesforce?
A. There are two types of triggers: Before triggers are used to update or validate record values before they’re saved to the database.
Q. What is JavaScript remoting in Salesforce?
A. JavaScript remoting is a tool that front-end developers can use to make an AJAX request from a Visualforce page directly to an Apex controller. JavaScript remoting allows you to run asynchronous actions by decoupling the page from the controller and to perform tasks on the page without having to reload the entire page
Q. What is Apex Param?
A. Basically the apex:param tag is used to pass values from the Visualforce Page to the Apex Controller.
Q. What is the use of wrapper class in Salesforce?
A. A wrapper or container class is a class, data structure, or an abstract data type whose instances are a collections of other objects.It is a custom object defined by Salesforce developer where he defines the properties of the wrapper class.
Q. What is transient keyword in Salesforce?
A. Transient keyword in Apex classes that are serializable, namely in controllers, controller extensions, or classes that implement the Batchable or Schedulable interface. … Declaring variables as transient reduces view state size.
Q. What is trigger ?
A. Trigger is piece of code that is executes before and after a record is Inserted/Updated/Deleted from the force.com database.
Q. What are different types of triggers in sfdc?
A. 1.Before Triggers-These triggers are fired before the data is saved into the database.2.After Triggers-These triggers are fired after the data is saved into the database.
Q. What are trigger context variables?
A. Trigger.isInsert: Returns true if the trigger was fired due to insert operation.Trigger.isUpdate: Returns true if the trigger was fired due to update operation.
Trigger.isDelete: Returns true if the trigger was fired due to delete operation.
Trigger.isBefore: Returns true if the trigger was fired before record is saved.
Trigger.isAfter: Returns true if the trigger was fired after record is saved.
Trigger.New: Returns a list of new version of sObject records.
Trigger.Old: Returns a list of old version of sObject records.
Trigger.NewMap: Returns a map of new version of sObject records. (map is stored in the form of map)
Trigger.OldMap: Returns a map of old version of sObject records. (map is stored in the form of map)
Trigger.Size: Returns a integer (total number of records invoked due to trigger invocation for the both old and new)
Trigger.isExecuting: Returns true if the current apex code is a trigger.
Q. What is the difference between Trigger.New and Trigger.NewMap?
A. Trigger.New is Returns a list of new version of sObject records butTrigger.NewMap is Returns a map of new version of sObject records.
Q. What is the difference between Trigger.New and Trigger.Old?
A. Trigger.New is Returns a list of new version of sObject records andTrigger.Old is Returns a list of old version of sObject records.
Q. Can we call the callouts from trigger?
A. yes we can. It is same as usual class method calling from trigger. The only difference being the method should always be asynchronous with @future
Q. What is the recursive trigger?
A. Recursion occurs in trigger if your trigger has a same DML statement and the same dml condition is used in trigger firing condition on the same object(on which trigger has been written)
Q. What is the bulkifying triggers?
A. By default every trigger is a bulk trigger which is used to process the multiple records at a time as a batch. For each batch of 200 records.
Q. What is the use of future methods in triggers?
A. Using @Future annotation we can convert the Trigger into a Asynchrinous Class and we can use a Callout method.
Q. What is the order of executing the trigger apex?
A. 1. Executes all before triggers.
2. Validation rules.
3. Executes all after triggers.
4. Executes assignment rules.
5. Executes auto-response rules.
6. Executes workflow rules.
7. If there are workflow field updates, updates the record again.
8. If the record was updated with workflow field updates, fires before and after triggers one more time. Custom validation rules are not run again.
9. Executes escalation rules.
10. If the record contains a roll-up summary field or is part of a cross-object workflow, performs calculations and updates the roll-up summary field in the parent record. Parent record goes through save procedure.
11. If the parent record is updated, and a grand-parent record contains a roll-up summary field or is part of a cross-object workflow, performs calculations and updates the roll-up summary field in the parent record. Grand-parent record goes through save procedure.
12. Executes Criteria Based Sharing evaluation.
13. Commits all DML operations to the database.
14. Executes post-commit logic. Ex: Sending email.
Q. How do we avoid recursive triggers?
A. Use a static variable in an Apex class to avoid an infinite loop. Static variables are local to the context of a Web request.
Q. How many triggers we can define on a object?
A. We can write more than one trigger But it is not recommended .Best practice is One trigger On One object.
Q. What are the soql limitations in apex?
A. Total number of records retrieved by SOQL queries-50,000
Q. What are the transaction limitations in apex?
A. Each execution of a batch Apex job is considered a discrete transaction.
For example, a batch Apex job that contains 1,000 records and is executed without the optional scope parameter from Database.executeBatch is considered five transactions of 200 records each.
The Apex governor limits are reset for each transaction.
If the first transaction succeeds but the second fails, the database updates made in the first transaction are not rolled back.
Q. What is the need of batch apex?
A. By using Batch apex classes we can process the records in batches in asynchronously.
Q. What is Database.Batchable interface?
A. The class that implements this interface can be executed as a batch Apex job.
Q. Define the methods in batchable interface?
A. Start:
global Database.Querylocator start (Database.BatchableContext bc){}
Execute:
global void execute(Database.BatchableContext bc,List <p>){}
Finish:
global void finish(Database.BatchableContext bc) {}
Q. What is purpose of start method in batch apex?
A. It collect the records or objects to be passed to the interface method execute.
Q. What is the Database.QueryLocator?
A. If we use a Database.QueryLocator,the governor limit for the total number of records retrieved by SOQL queries is bypassed. (Default 50,000 It allow up to 50 million records).
Q. What is the iterable<Sobject>?
A. If you use an iterable,the governor limit for the total number of records retrieved by SOQL queries is still enforced.
Q. What is the use of execute method?
A. Contains or calls the main execution logic for the batch job.
Q. How many times execute method is called?
A. Execute method is called for each batch of records.
Q. What is the scope of execute method?
A. The maximum value for the optional scope parameter is 2,000
Q. Can we call callouts from batch apex?
A. Yes we can call.
Q. Can we call another batch apex from batch apex?
A. Yes you can call a batch apex from another batch apex .Either in start method or in finish method you can call other batch
Q. How many callouts we can call in batch apex?
A. Batch executions are limited to one callout per execution.
Q. Batch is synchronous or Asynchronous operations?
A. Asynchronous operations.
Q. What is the default size of the batch ?
A. The default batch size is 200 records
Q. What is the Database.BatchableContext?
A. BatchableContext Interface is Represents the parameter type of a batch job method and contains the batch job ID. This interface is implemented internally by Apex.
Q. How to track the details of the current running Batch using BatchableContext?
A. You can check the AsyncApexJob.Status using the JobId from the Database.BatchableContext.
Q. How many batch jobs can be added to queue?
A. Queued counts toward the limit of 5.
Q. What is Database.State full interface?
A. To maintain variable value inside the Batch class, Database.Stateful is used.
Q. What is Database.AllowCallouts?
A. To use a callout in batch Apex, you must specify Database.AllowsCallouts in the class definition. For example:
global class SearchAndReplace implements Database.Batchable<sObject>,
Database.AllowsCallouts{
//Business logic you want by implementing Batchable interface methods
}
Callouts include HTTP requests as well as methods defined with the webService keyword.
Q. What is AsyncApexJob object?
A. AsyncApexJob is Represents an individual Apex sharing recalculation job.Use this object to query Apex batch jobs in your organization.
Q. When a BatchApexworker record is created?
A. For each 10,000 AsyncApexJob records, Apex creates one additional AsyncApexJob record of type BatchApexWorker for internal use.

Keep Visiting us !! we will update more questions

No tags for this post.

Like Us for FB Page

Trailhead Profile

Subscribe Us




Global View