Salesforce Questions
===============================
QUESTIONS ON PROFILES,PERMISSION SET,USERS,OWD,ROLES AND SHARING RULES IN SALESFORCE
================================
1.What is Profile?
ANS: Profile contains set of permissions and access settings that controls what user can do with in the organization.
2. What are permission sets?
ANS: A set of permissions is given to the users without changing the profile.
3.What is OWD?
ANS: OWD'S are base line record level security for objects in the organization.
It is used to restrict access to data.
4.What is Roles?
ANS: A role controls the level of visibility that users have to an organization's data.
5.What is User?
ANS:The people who have authenticated username and password to login to the salesforce successfully.
6.What is Sharing Rules?
ANS:These are used to override the OWD permissions.
Sharing rules are two types
1.Based on record owner
2.Based on criteria.
7.What is the role hierarchy?
ANS:Role Hierarchy states that higher hierarchy person can see lower hierarchy person records.
8.Can you override profile permissions with permission sets(i have defined some permissions in profile,i am trying to use permission sets for
the same object,can i override permissions for a particular object in the permission sets over to the profile?
ANS:No. Permission Sets are used only to extend the Profile permissions. It never overrides.
9. I want to have read/write permission for User 1 and read only for User 2, how can you acheive?
ANS:Create a Permission Set with read/write and assign it to User 1.
10. I have an OWD which is read only, how all can access my data and I want to give read write access for a particular record to them,
how can i do that?
ANS:All users can just Read the record.
Create a Sharing Rule to give Read/Write access with "Based on criteria" Sharing Rules.
11.What is the difference between role hierarchy and sharing rules?will both do the same permissions?
ANS:Role Hierarchy states that higher hierarchy person can see lower hierarchy person records.
Sharing Rule is used to extend Role Hierarchy.
12. Is it possible to delete the user in salesforce?
ANS:No, once we create an user in salesforce we cannot delete the user record. We can only deactivate the user record.
13.How to provide security for Meta-Data files (Schema)?
ANS:Using Profiles and Permission Sets.
13. How to give permissions to two fields for different users who belongs to different profiles?
ANS:Permission set
14.What is Grant Access Using Hierarchies?
ANS:In OWD we have Private but your higher position persons should see that time we go for Grant Access Using Hierarchies.
15. How we can change the Grant access using role hierarchy for standard objects?
ANS:Not possible.
16.What is manual sharing?
ANS:Manual sharing is to share a record to a particular user manually.
Go to detail page of record and click on manual sharing button and assign that record to other user with Read or Read/Write access.
Manual Sharing button enables only when OWD is private to that object.
17.Can you tell the difference between Profile and Roles?
ANS:Profiles are used for Object level access settings.
Roles are used for Record level access settings.
=========================================
QUESTIONS ON TRIGGERS IN SALESFORCE
=========================================
1.What is trigger ?
Ans: Trigger is piece of code that is executes before and after a record is Inserted/Updated/Deleted from the force.com database.
Owner Change and Roll up summary fire the trigger and workflow Rule but Formula not.
Add Error work only before insert and before updates and before delete
Trigger.old --- Read Only
Before Insert -- Change value only, Update and delete DML is not allowed(Original object is not Created).
After Insert, After Undelete ----Value Can't change(Runtime Exception),Update and Delete(useless after insert object is deleted) allowed(Get the object on id basis and update and delete it).
Before Update --- Change Value only, DML Not allowed (Update,Delete,Both Trigger.new and Trigger.old).
After Update ----Value Can't Change(Runtime Exception),Update and delete allow if we manage recursive trigger.
Before Delete---Value can't change(Trigger.new is not available), Delete not allowed, Update allow
After Delete---Value can't change(Trigger.new is not available). Update and delete not allowed(Because object is already deleted)
upsert triggers fire both before and after insert or before and after update triggers as appropriate.
merge triggers fire both before and after delete triggers for the losing records and before update triggers for the winning record only.
Field history is not recorded until the end of a trigger. If you query field history in a trigger, you don’t see any history for the current transaction.
All triggers are bulk triggers by default, and can process multiple records at a time
2.What are different types of triggers in sfdc?
Ans: 1.Before Triggers - These triggers are fired before the data is saved into the database.
Before triggers are used to update or validate record values before they’re saved to the database.
2.After Triggers - These triggers are fired after the data is saved into the database and used to access field values that are set by the system(id, LastModifiedDate).
For work on child records
3. What is the Syntax of trigger?
Ans. Trigger Syntax :trigger TriggerName on ObjectName (trigger_events) {
code_block
}
The code block of a trigger cannot contain the static keyword. Triggers can only contain keywords applicable to an inner class.
3.What are trigger context variables?
Ans: Allow developers to access run-time context. These variables are contained in the System.Trigger class.
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.
4.What is the difference between Trigger.New and Trigger.NewMap?
Ans:Trigger.New is Returns a list of new version of sObject records but Trigger.NewMap is Returns a map of new version of sObject records.
5.What is the difference between Trigger.New and Trigger.Old?
Ans:Trigger.New is Returns a list of new version of sObject records and Trigger.Old is Returns a list of old version of sObject records.
6.What is the difference between Trigger.New and Trigger.Old in update triggers?
Ans: Trigger.new contains the new value after updating the records and Trigger.old contains the old value after updating the records in update trigger.
7.Can we call batch apex from the Trigger?
Ans: A batch apex can be called from a class as well as from trigger code.
In your Trigger code something like below :-
// BatchClass is the name of batchclass
BatchClass bh = new BatchClass();
Database.executeBacth(bh);
8.What are the problems you have encountered when calling batch apex from the trigger?
Ans: Batch will fire for every operation in each context.
9.Can we call the callouts from trigger?
Ans: 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
10.What are the problems you have encountered when calling apex the callouts in trigger?
Ans: Direct Callout is not allowed in trigger always use @future method.
11.What is the recursive trigger?
Ans: 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)
12.What is the bulkifying triggers?
Ans: 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.
(Exa: Data Import, Mass delete,update recod owner).
Minimize the number of DML operations
Minimize the number of SOQL statements
13.What is the use of future methods in triggers?
Ans: Using @Future annotation we can convert the Trigger into a Asynchronous Class and we can use a Callout method.
14.What is the order of executing the trigger apex?
Ans:
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.
15.What is the trigger handler?
Ans: Trigger Handler is an apex class and we can call this class method form trigger that implements all the logic here.
16.How do we avoid recursive triggers?
Ans: Use a static variable in an Apex class to avoid an infinite loop. Static variables are local to the context of a Web request.
public class AccountProcessor{
public static boolean Firstrun= true;
}
17.How many triggers we can define on a object?
Ans: We can write more than one trigger But it is not recommended .Best practice is One trigger On One object.
18.Can we define triggers with same event on single object?
Ans:Yes, But order of execution not sure
19.How many time workflow field update will be called in triggers?
Ans: one times
20. Best Practice of apex code?
Ans. Bulkify your Code
Avoid SOQL Queries or DML statements inside FOR Loops
Using Collections
Avoid Multiple Triggers on the Same Object
Querying Large Data Sets
Use of the Limits Apex Methods to Avoid Hitting Governor Limits
Avoid Hardcoding IDs
Writing Test Methods to Verify Large Datasets
Use @future Appropriately
21. There is a validation rule which will fire if amount = 100 and will display the error message. There is a workflow rule which will fire
if amount > 100 and will update amount field to 100. One of user saved the record by giving value as 1000.
what will the value of the amount field.
Ans. Validation rules will fire first then workflow rules will fire. So, the answer is 100 (Even though there is a validation rule because of the workflow rule it will accept 100 in the amount field).
=========================================
QUESTIONS ON BATCH APEX IN SALESFORCE
=========================================
1.What are the soql limitations in apex?
Ans: Total number of records retrieved by SOQL queries-50,000
2.What are the transaction limitations in apex?
Ans: 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.
3.What is the need of batch apex?
Ans: By using Batch apex classes we can process the records in batches in asynchronously.
4.What is Database.Batchable interface?
Ans: The class that implements this interface can be executed as a batch Apex job.
5.Define the methods in batchable interface?
Ans:
Start:
global Database.Querylocator start (Database.BatchableContext bc){}
Execute:
global void execute(Database.BatchableContext bc,List ){}
Finish:
global void finish(Database.BatchableContext bc) {}
6.What is purpose of start method in batch apex?
Ans: It collect the records or objects to be passed to the interface method execute.
7.What is the Database.QueryLocator?
Ans: 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).
8.What is the iterable?
Ans: If you use an iterable,
the governor limit for the total number of records retrieved by SOQL queries is still enforced.
9.What is the use of execute method?
Ans: Contains or calls the main execution logic for the batch job.
10.How many times execute method is called?
Ans: Execute method is called for each batch of records.
11.What is the scope of execute method?
Ans: The maximum value for the optional scope parameter is 2,000
12.Can we call callouts from batch apex?
Ans: Yes we can call.
13.Can we call another batch apex from batch apex?
Ans: Yes you can call a batch apex from another batch apex .Either in start method or in finish method you can call other batch
14.How many callouts we can call in batch apex?
Ans: Batch executions are limited to one callout per execution.
15.Batch is synchronous or Asynchronous operations?
Ans: Asynchronous operations.
16.What is the maximum size of the batch and minimum size of the batch ?
Ans: The default batch size is 200 records. min?
max?
17.What is the Database.BatchableContext?
Ans: 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.
18.How to track the details of the current running Batch using BatchableContext?
Ans: You can check the AsyncApexJob.Status using the JobId from the Database.BatchableContext.
19.How many batch jobs can be added to queue?
Ans: Queued counts toward the limit of 5.
20.What is Database.State full interface?
Ans:To maintain variable value inside the Batch class, Database.Stateful is used.
21.What is Database.AllowCallouts?
Ans:
To use a callout in batch Apex, you must specify Database.AllowsCallouts in the class definition. For example:
global class SearchAndReplace implements Database.Batchable,
Database.AllowsCallouts{
//Business logic you want by implementing Batchable interface methods
}
Callouts include HTTP requests as well as methods defined with the webService keyword.
22.What is AsyncApexJob object?
Ans: AsyncApexJob is Represents an individual Apex sharing recalculation job.
Use this object to query Apex batch jobs in your organization.
23.When a BatchApexworker record is created?
Ans: For each 10,000 AsyncApexJob records, Apex creates one additional AsyncApexJob record of type BatchApexWorker for internal use.
24. Is it possbile to write batch class and schedulable class in a same class?
Ans. By implementing Database.Batchable and Schedulable interfaces we can implement the methods in a same class.
================================================
QUESTIONS ON WORKFLOWS AND APPROVAL PROCESS IN SALESFORCE
================================================
1. What is work flow ?
Ans: Work flow works based on certain criteria,By using workflow we can automate the business process like Email alerts,tasks,filed updates
2. What are the different kinds of evaluation criteria’s (events)?
Ans: 1.created
2.created, and every time it’s edited
3.created, and any time it’s edited to subsequently meet criteria
3. In which object workflows are stored?
Ans: Workflow
4. What is the difference between Created and everytime edited to meet the criteria and Created and edited to subsequently meet the criteria?
Ans: If we select 'Created and everytime edited to meet the criteria' whenever we create a record or edit a record if the criteria of the workflow rule meets then it will trigger every time. If we select 'Created and edited to subsequently meet the criteria' -
While creating the record criteria meets so that workflow will fire and while editing the record again criteria meets workflow won't fire (meeting the criteria to meeting the criteria)
While creating the record criteria doesn't meet so workflow won't fire and while editing the record workflow criteria meets then workflow will fire (not meeting the criteria to meeting the criteria)
Conclusion: Previous state of record should be not meeting criteria and current state of record should be meeting the criteria then only in current state workflow will fire.
5.What are the types of rule criteria’s?
Ans: 1.Criteria meet (field - operator - value, if there are multiple criteria’s then in filter criteria we can give conditions like ( 1 or 2) and 3, field to field comparison is not possible, we can't fetch the previous state information of the field )
2.Formula evaluated (we can write formulas with this we can do field to field comparison and we can fetch previous state value of the record)
6. What is immediate workflow action?
Ans: The action which will be performed immediately after the record criteria meets.
7. What is time dependent workflow action?
Ans: The action which will be performed in future based on the any of the date field. To create time dependent workflow action we should create one time trigger. in time trigger we can give either days or hours with the maximum of 999 value and we can select either before or after.
8. For which event we can't create time dependent workflow action?
Ans: Created and everytime edited to meet the criteria.
9. What are the different kinds of workflow actions?
Ans: New field update (we can update a field of the same object or the fields of the parent objects which are at master side in master-detail relationship, only for master-detail parent objects we can update the field and for lookup we can't update)
New email alert (we can send emails if the criteria meets)
New task (we can create new task)
New outbound Message (we can make a callout)
10. What are the types of email templates?
Ans:1.Text
2.HTML (with letter head)
3.Custom HTML (without letter head)
4.Visual Force
12. How can you monitor future actions of time based workflow?
Ans: setup --> administration set up --> monitoring --> time based workflow
13. There is a timebased workflow which will update one of the fields if the criteria meet. User submits the record with valid criteria,
workflow triggered so that the field update is queued in the 'time based flow' queue which will fire after one day. If the user modifies the
record which is submitted before the scheduled date, after modification, a record criterion is not meeting. Whether the field will be updated
or not in schedule date?
Ans: It won't trigger in the schedule date because if we modify the record to not meeting criteria that queued field update will be removed
from the 'time based flow' queue.
14. For the same scenario explained in the above question what happens when we deactivate or modify the criteria of the workflow to different
criteria? Whether the field will be updated or not in schedule date?
Ans: Yes, It will trigger in scheduled date.
15. Scenario: There are two workflow rules on the same object say namely wf1 and wf2. If wf1 fires then a field will be updated on the same
object, if the field updated and due to this wf2 criteria meets then what will happen, wf2 will fire or not?
Ans: It won't fire. To fire wf2 we should enable 'Re-evaluate Workflow Rules' checkbox of the field update which is there in wf1.
16. What is recursive workflow rule? How to avoid recursive workflow rules?
Ans:Whenever we enable Re-evaluate Workflow Rules after Field Change checkbox in the Field Update of a workflow rule, due to this field update other workflow rules on the same object will be fired if the entery criteria of those workflow rules satisfied.
Incase, in other workflow rules also if we enable Re-evaluate Workflow Rules after Field Change checkbox in the Field Update recursive workflow rules will come in some scenarios.
We can take two steps to avoid recursive workflow rules -
For the workflow Evaluation Criteria if you choose created, and any time it’s edited to subsequently meet criteria option, we can avoid recursive workflow rules.
If you don't enable Re-evaluate Workflow Rules after Field Change checkbox in the Field Update of a workflow rule we can avoid.
17. What is Approval Process?
Ans: If the criteria of the record meets then by clicking on submit for Approval button user can submit the record for approval (Note: Approval history related list should be displayed on the record detail page)
18. Scenario: After activating the approval process, I want to add one more step. Is it possible?
Ans: It’s not possible, to add one more step deactivate the approval process and clone the deactivated approval process and add the new steps.
19.In which object all Approval process are stored?
Ans: Approval
==================================================
QUESTIONS ON REPORTS AND DASHBOARD IN SALESFORCE
==================================================
1. What is Report?
To summarize the information of an object we use reports.
2. What are the types of Reports?
Tabular (Displays records just like a table)
Summary (we can summarize the information based on certain fields)
Matrix (we can summarize the information in two dimensional manner, both rows and columns)
Join (we can summarize information in different blocks on the same object and the related objects)
3. How many blocks we can create for join reports?
5 blocks.
4. How many maximum groupings we can do for summary, matrix and join reports?
3 groupings
5. What is bucketing in reports?
Bucket field in Reports in Salesforce is used to group values to the name we specify.
It can group only the below data types fields
1. Picklist
2. Number
3. Text
6. How many records we can display on page for a report?
We can display up to 2000 records on a page. If more records are there to display we cannot see those through user interface. If you export the records to a excel sheet then you can export all records.
7.Can we mass delete reports using Apex (Anonymous Apex)?
Salesforce has not exposed any API for Reports. So best way is :
Move all reports needs to delete in new folder.
Inform everyone that reports will be deleted after some time may be 30 days.
Import your reports folder in Eclipse including all reports to be deleted and then delete the the reports folder in eclipse. It will delete all the reports at once.
8.Explain what is dashboard?
Dashboard is the pictorial representation of the report, and we can add up to 20 reports in a single dashboard.
9.What are the different Dashboard Components?
Salesforce dashboard components are used to represent data. Salesforce dashboards have some visual representation components like graphs, charts, gauges, tables, metrics and visualforce pages. We can use up to 20 components in single dashboard.
10.Is it possible to schedule a dynamic dashboard in Salesforce?
No, it is not possible to schedule a dynamic dashboard in Salesforce.
11.Which type of report can be used for dashboard components?
Summary and matric report.
12.Explain dynamic Dashboard?
Dynamic dashboards in Salesforce displays set of metrics that we want across all levels of your organization.
Dynamic Dashboards in salesforce are Created to provide security settings for the dashboards in salesforce.com.
We may have a requirement in an organization to “view all data” by every user in an organization according to their access we have to select
Run as Logged-in User. There are two setting option in Dashboards.
They are
1.Run as specified User.
2.Run as Logged-in User.
=====================================================
QUESTIONS ON REST API AND SOAP API IN SALESFORCE
=====================================================
Callout can not perform after dml operation in same transaction
Callout can not perform after dml operation(Future method is called before callout) in same transaction
Callout not stop the execution, i am inserting a record after callout
1.What is SOAP and What is REST?
REST API
Representational State Transfer.
It is based URI
It works with GET,POST,PUT,DELETE
Works Over with HTTP and HTTPS
SOAP API
Simple Object Access Protocol.
It is based on Standard XML format
It is works with WSDL(Web Services Description Language)
Works Over with HTTP,HTTPS,SMPT,XMPP
2.Difference between REST API and SOAP API?
Ans :Varies on records that can be handled. Generally if we want to access less number of records we go for REST API.
3.What is WSDL?
A WSDL is an XML Document which contains a standardized description of how to communicate using webservice.
4.What are the different type of WSDL'S?
Ans:
Enterprise WSDL
Partner WSDL
Apex WSDL
Metadata WSDL
Tooling WSDL
Delegated Atuntection WSDL
5.Difference between Enterprise WSDL and Partner WSDL?
Ans:
Enterprise WSDL:
It is used for building client applications for a single salesforce organization.
Customers who use enterprise WSDL document must download and re-consume it when ever their organization makes a change to its custom objects or fields or when ever they want to use a different version of the API.
Partner WSDL:
It is used for building client applications for multiple organizations.
The partner WSDL documention only needs to be downloaded consumed once per version of the API.
6.How can you expose an apex class as a REST web service in salesforce?
Ans - An apex class can be exposed as REST web service by using keyword '@RestResource'
7.How to fetch data from another Salesforce instance using API?
Ans :Use the Force.com Web Services API or Bulk API to transfer data We this this is a great job for the Bulk API.
8.How to call Apex method from a Custom Button?
Ans :An Apex callout enables you to tightly integrate your Apex with an external service by making a call to an external Web service or sending a HTTP request from Apex code and then receiving the response.
Apex provides integration with Web services that utilize SOAP and WSDL, or HTTP services (RESTful services).
9.What is the use of Chatter REST API?
The Chatter API (also called Chatter REST API) lets you access Chatter information via an optimized REST-based API accessible from any platform. Developers can now build social applications for mobile devices, or highly interactive websites, quickly and efficiently.
10.How to fetch data from another Salesforce instance using API?
Answer: Use the FORCE.COM WEB SERVICES API or BULK API to transfer data We this this is a great job for the Bulk API.
11.What are callouts and call ins?
Making a request to an external system from salsforce is callout.
Getting requests from an external system is a call in.
12.How many callouts to external service can be made in a single apex transaction?
Ans - A total of 10 callouts are allowed in a single apex transaction.
13.What is the maximum allowed time limit while making a callout to external service in apex?
Ans - maximum of 120 second time limit is enforced while making callout to external service
14.What is the default timeout period while calling webservice from Apex.
Ans : 10 sec.
15.can we define custom time out for each call out?
Ans :
A custom time time can be defined for each callout.
the minimum time is 1 millisecond and maximum is 120,000 milli seconds.
16.How to increase timeout while calling web service from Apex ?
Ans :
docSample.DocSamplePort stub = new docSample.DocSamplePort();
stub.timeout_x = 2000; // timeout in milliseconds
17.What is the use of JSON?
================================
================================
1. For which criteria in workflow "time dependent workflow action" cannot be created?
Ans: created, and every time it’s edited (Why Reason: if we edit record for other field again time Based workflow fire unnecessarily)
2. What is the advantage of using custom settings?
Ans : You don't have to query in apex (fire select query) to retrieve the data stored in custom
settings.
List Custom Settings
A type of custom setting that provides a reusable set of static data that can be accessed across your organization.
Data in list settings does not vary with profile or user, but is available organization-wide.
Hierarchy Custom Settings
The hierarchy logic checks the organization, profile, and user settings for the current user and returns the most specific, or “lowest,” value.
3. What are the different workflow actions available in workflows?
Ans: 1. Field update 2. Email alert 3. send Outbound messages 4. Create new task
4. What is whoid and whatid in activities?
Ans: Whoid is the id of either contact or Lead. Whatid is the id of the related to record in
activity record(standard or custom object)
5. What is the difference between a standard controller and custom controller
Ans: standard controller inherits all the standard object properties, standard button
functionalities can be directly used. Custom controller defines custom functionalities,
a standard controller can be extended to develop custom functionalities using keyword "extensions"
6. Can you have more than one extensions associated with a single page?
Ans : Yes we can have more than extensions.
7. If page is having multiple extensions and if two extensions have methods of same name.Then which method out of these two will be called upon
calling from vf page ?
Ans: The one which is present in the controller defined on the left side will be called.
8. What are governor limits ?
Ans: Governor limits are the limits imposed by salesforce so as to avoid monopoly by orgs in using salesforce shared resources.
9. How can we implement pagination in visualforce ?
Ans: use standardset controllers for implementing pagination.
10. What is the difference between force.com and salesforce.com?
Ans: force.com is paas(platform as a service) and salesforce.com is Saas(software as a service)
11. What is a externalid in salesforce?
Ans: It is a field which can be used to store a value that is used as a reference for that record in other system.
For example if you have a record in system 'xyz' where it is referenced by some value then that value can be used as external id in salesforce for that record.
External id can be used for upsert operation in data loader.
12. What happens upon lead conversion ?
Ans: When lead is converted a contact(Lead Name), account(Company Name) and optionally an opportunity is created.
13. What are different ways of deployment in salesforce ?
Ans: Change sets, eclipse and ANT(Another Neat Tool)
14. How can you override a list button with a visuaflorce page?
Ans: Visualforce page should be a list controller that is it should have "recordsetVar" attribute defined in page tag.
15. Is it possible to bypass Grant Access Using Hierarchies in case of standard objects ?
Ans : No. This is default and cannot be changed.
16. How can you call a controller method from java script ?
Ans: Use action function component to call controller method from java script.
17. How can you call a visualforce page from a controller method?
Ans: Use pagereference object for calling a visualforce page from controller method.
18. How can you sort a select SOQl query ?
Ans: use order by clause in select query for sorting a list of records.
19. How much code coverage is needed for deployment?
Ans : Each trigger should have minimum of 1%. Class can have 0%. But, the total code coverage of 75%.
20. Can 'set' store duplicate values in it?
Ans : No. Set only stores unique values. List can have duplicate values in it.
21. Can two users have same profiles?
Ans: Yes
22. How can you refresh a particular section of a visualforce page?
Ans: This can be done using reRender attribute
23. How can you create a many to many relationship in salesforce?
Ans: This can be done by creating junction object between the two objects.
24. What happens to detail record when a master record is deleted?
Ans: detail record gets deleted.
25. What happens to child record when a parent record is deleted(look up relationship)?
Ans. Child record will not be delete
26. How to get current logged in users id in apex ?
Ans: Use Userinfo.getuserid() to get the current logged in user's id in apex.
27. How to convert a csv file browsed in visualforce page into a string?
Ans: use csvfilecontents.tostring(). method to convert blob to string
28.How many records can a select query return ?
Ans : As of now it can return upto 50000 records.
29. How many records can a sosl query return ?
Ans: as of now it can return upto 2000 records
30. How to fire dynamic query in soql?
Ans: Using database.query
Example: List accList = Database.query('select name from account');
31.What is a bucket field in reports?
Ans: This field is used for custom grouping of values in a field. This can be used in summarizing the report.
32. What are dynamic dashboards ?
Ans: Dashboards which run for logged in user are dynamic dashboards
33. Can the dynamic dashboards be scheduled?
Ans: No they cannot be scheduled.
34.How can you use custom label; in visualforce page?
Ans: Use this syntax for accessing custom label in visualforce page - {!$Label.Samplelabel}
35.What are the types of custom settings in salesforce?
Ans: List type and Hierarchy type
36.What are the different types of collections in apex?
Ans: There are three types of collections in apex language
1. Set
2. List
3. Map
37. What are maps in apex?
Ans: Map has keys and values. A key points to a single value. Map can be used to store relationship between two entities. Keys in map are
unique. Values can be duplicated.
38. What are the different types of object relations in salesforce ?
Ans: 1. Look Up(1:N)
2. Many to many
3. Master detail
39.Can you have roll up summary fields in case of parent child relationship?
Ans: No. These are present only in case of master details relationship.
40. Can you see a lead which is converted in saleforce UI?
Ans: The detail record is not seen. But a page, wherein it shows the links for formed account, contact and opportunity.
41. What is the difference between action function and action support ?
Ans: Action functions can call controller method from java script, action support adds support to other components.
42. What is action poller in visualforce ?
Ans: Action poller sends AJAX request with a specified time interval.
43. What are the different types of reports available in salesforce?
Ans: 1. tabular report
2. Summary Report
3. Matrix Report
4. Joined Report
44. How many active assignments rule can you have in lead/Case?
Ans: You can have only one active assignment rule at a time.
45. How do we access static resource in visualforce?
Ans: Use this syntax for accessing static resource {!$Resource.Testresourcename}
46. How to embed a visualflow in a visualforce page ?
Ans: Use this syntax to embed flow in vf page :
47. How to enable inline editing in visauflorce page ?
Ans You can enable inline editing in visualforce page by using component.
48. What is trigger.new in trigger ?
Ans: trigger.new is a list of records that are in the context of trigger or becuase of these records(modification,Creation, deletion) the trigger has been called
49. How do we bulkify the trigger ?
Ans: Bulkfification requires iterating over all the records in trigger context
for example : for(account ac: trigger.new){
// your logic here
}
50.How can we get the old value in trigger ?
Ans: use trigger.old map for getting previous values of fields.
51. Can we modify records directly in trigger.new ?
Ans: trigger.new is a read only list, but field values can be changed in case of before trigger.
52. What does the error "list has no rows for assignment" mean?
Ans: it means the list you are trying to access has no values in it.
53. Why should we not write select query within for loop?
Ans: Writing select query within for loop may hit the governor limit of 100 select queries.
54. What should we do to avoid view state error in visualforce page?
Ans: Clear unused collections, define variable as transient.
55. What is a sandbox org?
Ans: It is the exact copy of your production org.
56.What is sosl?
Ans: select query that can return records of multiple objects as list of lists.
57. How many records a select query soql can return?
Ans: as of now the limit is 50000
58. What is the full form of AJAX?
Ans: it stands for asynchronous java and XML
59. Why do we need to write test classes?
Ans: Salesforce does not allow deployment in production if the test coverage is less than 75%
60.How can you show a custom error message in trigger?
Ans: This can be done using addError() method in trigger
61. What is the use of future annotation?
Ans: Future method starts execution when Salesforce has resources available.That is for asynchronous execution.
62. How to identify if a class is a test class?
Ans: test class always begins with @isTest
63. How to convert a blob variable into a string?
Ans:Use toString to convert blob into string
64. what are the different methods of batch apex class?
Ans: start method, execute method and finish method
65.What is' with sharing' in apex class code?
Ans: When you use 'with sharing', user's permissions and field-level security are respected. In case of 'without sharing' code runs in system mode.
66. How many records can a sosl return ?
Ans: It can return 2000 records as of now as per governers limit
67.Can you use dml statement in visualforce component controller ?
Ans: To use dml in visualforce component you have to declare allowdml=true in visualforce component otherwise you will get an exception
"DML is currently not allowed"
68. Can you write sosl in trigger>?
Ans: Earlier this was not allowed but now sosl are allowed in triggers.
69. Which are the different access modifiers in apex?
Ans: 1. Private 2. Public 3. Protected 4.Global are the four access modifiers allowed in apex.
70. Can you change the master of a detail record in salesforce ?
Ans. Yes provided you have ticked marked "Allow reparenting" in field setting otherwise the field is read only and master cannot be changed.
71. How can you lock records in apex?
Ans: use For update in query to lock the record. For example: [select id,name from contact limit 10 For update];
72. Is there any limit on the number of items that can be stored in apex collections?
Ans: There is ni such limit but we need to consider heap size limit 6mb (6 MB as of now)
73. How can you monitor future actions of time based workflow?
Ans: setup --> administration set up --> monitoring --> time based workflow
74. What is visualforce component ?
Ans: It is a piece of code that can be reused. It can be encapsulated in other visualforce pages.
75. How can you display the status of an AJAX update request in a visualforce page ?
Ans: To display AJAX request status we can use component actionstatus.
76. How can you access custom label in apex:
Ans: Example --> string custLabelstr = System.Label.LabelNamehere
77.How can you get all the keys of a map variable ?
Ans: USe method keyset() for this
Example = Set idSet = mapname.keyset();
78. How can you compare values of a picklist field in validation rule?
Ans : for comparing picklist value use ispickval
ISPICKVAL(picklist_field, text_to_compare)
79.What are the different types of sandboxes in salesforce ?
Ans: Developer, Developer Pro, Partial Data and Full are the 4 types of sandboxes in salesforce.
80. With what frequency can you refresh a full copy sandbox?
Ans: full copy sandbox can be refreshed every 29 days from production.
81. How can you make fields required on a visualforce page?
Ans: mark required = true as done in the example below:
82. What is minimum coverage for every trigger for deployment?
Ans: every trigger should have a minimum coverage of 1%. Total coverage should be 75%
83. What is minimum coverage for every class for deployment?
Ans: There is no such requirement. A class can have 0% but the total coverage should be >75%
84. How can you implement custom functionality for a standardcontroller visualforce page?
Ans: This can be done by associating a controller class with that standard controller using "Extenssions"
85. How can you get the current record id in a visualforce page ?
Ans use ApexPages.CurrentPage().getparameters().get('id') to get the current record id in visaulforce page.
86. Can a user change his own profile in salesforce ?
Ans: No, a user cannot change change his own profile !!
87. Can a user change his own role?
Ans: Yes this can be done !!
88. Reset security token option is unavailable in set up. What could be the reason?
Ans: If in the profile setting "login ip ranges" have been set up then the option of "reset security token" is uanvailbale.
89. How can you skip record type selection page(and take up default record type) while creating new record of a aprticular object ?
Ans: just tickmark against the object by navigating to following :
set up --> my personal information -- > Record type selection --> check against the required object
90. What are the different data types that a standard field record name can have?
Ans: Record name field can have either of the two data types : Auto Number or Text data type
91.Can you edit a apex trigger/apex class in production environment ?
Ans: No apex trigger /class cannot be edited in production.
92. Can you edit a visualforce page in production environment ?
Ans: Yes this can be done.
93.How can you deliver a visualforce page in excel form ?
Ans: use contentType="application/vnd.ms-excel#Contacts.xls" in page component of visualforce page
94. What is trigger.new?
Ans: It is a list of records in current context in a trigger.
95. What does it mean when you get the error "too many soql queries 101 salesforce"?
Ans: It means you are hitting the limit of 100 soql queries as per governers limit
96. How can you create a input field for date on a visualforce page ?
Ans: To create a input date field on vf page you will have to bind it with a existing date field on any object.
97. How can you convert a text to upper string ?
Ans: stringname.toUppercase();
98. How can you convert a integer into a string ?
Ans: string.valueof(integerName);
99. What are the different types of email templates that can be created in salesforce?
Ans: Test, HTML (using Letterhead), Custom (without using Letterhead) and Visualforce.
100. How can you display different picklist values for picklist fields in different page layouts?
Ans: This can be done using record types.
101.Can you do a dml in constructor?
Ans: No this cannot be done.
102. What are the data types that can be returned by a formula field?
Ans: 1.Checkbox 2. currency 3.Date 4.Date/Time 5.Number 6.Percent 7.Text
103. Can you create a new profile from scratch ?
Ans: No, you have to clone from a existing profile and modify the settings as required.
104. What are custom labels in saleforce?
Ans custom labels are custom text values that can be accessed from apex codes and visualforce pages.
105. What is the character limit of custom label ?
Ans: Custom labels can be only 1000 characters long, not more than that.
106. How long can a sandbox name be?
Ans: It can only be of upto 10 characters not more than that.
107. Can you use sharing rules to restrict data access?
Ans No, sharing rule can only give wider access to data it cannot restrict data access.
108. Can you edit a formula field values in a record?
And: formula fields are read only and cannot be edited.
109. Can you edit roll up summary field values in a record?
Ans: No, roll up summary fields are read only and cannot be edited.
110. How can you create relationship between two objects in salesforce?
Ans relationship can be set up by crating either look up relationship field or master detail relationship fields on objects.
111. Can you create a roll up summary field on parent object?
Ans: Roll up summary fields can only be created if the relationship between objects is master detail type.
112. How can you place an entire visualforce page in a different visualforce page?
Ans - This can be done using include attribute.
113. How can you hard delete records in apex?
Ans - use emptyrecyclebin method as below
ex- delete myAccList;
DataBase.emptyRecycleBin(myAccList);
114. What all data types can a set store?
Ans - A set can store all primitive data types and sObjects but not collections.
115. What is the use of offset keyword in a soql query?
Ans - Using offset keyword return the records starting from desired location in the list. For example if we specify offset 8 then all the records starting from location 9 onwards would be returned.
116. How can you display an image as an field in a detail page of record?
Ans - This can be done using IMAGE function. A url of the image stored in document should be given in image function
117. When a lead is converted into account/contact will the trigger on account/contact fire?
Ans - In set up we can enable or disable whether triggers should run on conversion.
118. What happens to contacts when an account is deleted?
Ans - When an account is deleted all the contacts under it gets deleted.
119. What is an sObject type?
Ans - sObject refers to any object that can be stored in force.com platform database. ex. sObject s = new contact()
120. How many elements can be stored with in a collection(list,set,map)?
Ans - There is no limit on the number of elements that can be stored in a collection. However, we need to consider the heap size limit.
121.Expand SOQL and SOSL.
Ans - SOQL- salesforce object query language, SOSL - salesforce object search language.
122. What is the difference between soql and sosl?
Ans - SOQL can query records from a single object at a time, while sosl can query records from
multiple objects. SOQL returns a list while SOSL returns list of lists.
123. How can you query all records using an soql statement?
Ans - This can be done using ALL ROWS keyword. This queries all records including deleted records in recyclebin.
124. What is the use of @future annotation?
Ans - Using @future annotation with a method executes it whenever salesforce has resources available.
125. What are the different access modifiers that can be used with methods and variables?
Ans - Global, Public, private and protected
126. What is the significance of static keyword?
Ans - Methods, variables when defined as static are initialised only once when class is loaded.
Static variables are not transmitted as part of view state for a visualforce page.
127. Can custom setting be accessed in a test class?
Ans - Custom setting data is not available default in a test class. We have to set seeAllData parameter true while definig a test class as below.
@isTest(seeAlldata=true)
128. What is the difference between role and profile?
Ans - Role defines record level access while profile defines object level access.
129. On which objects can you create Queues?
Ans - Queues can be created on two standard objects (Lead and case) and also on all custom objects.
130. What are the different ways to invoke apex code?
Ans - Apex code can be invoked using DML operation(trigger), Apex class can be scheduled using schedulable interface(ex. batch apex),
apex code can be run through developer console, an apex class can be associated with a visualforce page.
131.Can you create sharing rules for detail objects?
Ans - No. Detail objects cannot have sharing rules as the detail objects do not have owner field with them.
132. How can view state error be avoided?
Ans - Use transient keyword with variables wherever possible, clear unused collections. Use 1 form tag in a visualforce page.
133.Consider that a record meets a workflow criteria for time based workflow action, the action goes in queue . Later, before the time based
action is triggered, the same record gets modified and the criteria previously met is changed and now it does not meet the workflow criteria, what happens to the time based action placed in queue?
Ans - The time based workflow action is removed from the queue and will not get fired.
134. What is the use of writing sharing rules?
Ans - Sharing rules extend the record/data access level which is set using OWD, role hierarchy.
Sharing rule cannot restrict the data visibility but can only widen it.
135. Which all field data types can be used as external ids?
Ans - An external id can be of type text, number or email type
136. What is a mini page layout?
Ans - Mini page layout defines fields and related list to be displayed in hover detail and console tab.
Whenever you hover mouse over any recently viewed record the fields are displayed, related list is
not displayed(fields can be set in mini page layout).
Console tab fields and related list on the right hand side are also controlled by mini page layout.
137. What is the use of console view/console tab?
Ans - Console gives list views and related list records for multiple objects on a single
screen without any customization (visualforce page or controller)
138.What is @future annotation in apex?
Ans - It is used to indicate that code should be executed asynchronously when salesforce has available resources.
139. What are the different considerations that must be followed when using @future annotation in apex method?
Ans - 1. Method must be static 2. It must return void and 3. method can have argument of type primitives,collection of primitives or arrays of primitives
140. How can you execute batch apex programmatically?
Ans - Batch apex can be invokde using Database.executebatch(). Ex- Id batchprocessId = Database.executebatch(mybatchapexclass,200)
141. How can you set the batch size in batch apex ?
Ans - This can be set using optional scope parameter in database.
executebatch (batchapexname,batchsize) example - Id batchprocessId = Database.executebatch (mybatchapexclass,200) in this example batch size is set to 200
142. How can you monitor batch apex job?
Ans - Batch apex job can be monitored by navigating to your name
--> setup --> monitoring --> Apex jobs
143. What is the difference between List type custom setting and Hierarchy type custom setting?
Ans - List type stores static data that can be used in apex code as it is examples could be country
codes,currencies etc
Hierarchy type stores data that may change depending on user,profile or org wide default
144. Where can custom setting data be accessed?
Ans - Custom setting data can be accessed in formula fields,validation Rule, Visualforce, Apex, and the Force.com Web Services API(Hierarchy type Hide)
145. What different return types can be returned by SOQL?
Ans - A SOQL can return List of objects, a single object or an integer
146.What are the different exceptions in apex?
Ans - Apex exceptions can be built in or we can also create our own custom exceptions.
Exception class is the super class of all the built in exceptions.
So as to create a custom exception the class name should end with string 'exception' and it
should extend any of the built in exception class or other custom exception class.
147. What different access modifiers can be used for apex classes?
Ans - Apex classes can have either or these three access modifiers 1. Private 2. public 3. global
148. What different access modifiers can be used for class members?
Ans - Class members can have any of these four access modifiers 1. global 2. public 3. protected 4. private
149. What are governers limit in salesforce?
Ans - Governers limit are run time limits that are enforced by salesforce.
Governers limits are reset per transaction.
150. What is an apex transaction?
Ans - An apex transaction represents set of operations that are executed as a single synchronous unit.
151. What does heap in apex mean?
Ans - Every apex transaction has its heap. Heap is nothing but the garbage collected
at the end of every apex transaction.
152. How many callouts to external service can be made in a single apex transaction?
Ans - A total of 10 callouts are allowed in a single apex transaction
153.What is the maximum allowed time limit while making a callout to external service in apex?
Ans - maximum of 120 second time limit is enforced while making callout to external service
154. How can you expose an apex class as a REST web service in salesforce?
Ans - An apex class can be exposed as REST web service by using keyword '@RestResource'
155. What are custom controllers?
Ans - Custom controller is an apex class that implements all of the logic for a vf page without
leveraging standard controller
156. Can a custom controller class accept arguments?
Ans - No. A custom controller cannot accept any arguments and must use a no argument constructor for outer class.
157. What different type of method can be defined for VF controllers?
Ans - getter methods, setter methods and action methods
158. What are getter methods, setter methods?
Ans - Getter methods retrieve data from controller while setter methods pass data from page to
controller.
159.What is Organisation Wide Default in salesforce?
Ans - Organization wide default is used to set default access level for various standard objects
and all custom objects. Default access can be set as Public read only, Public read write,
Public read write and transfer for different objects.
For example if the record access level is set to private then the records will be
accessible only to owners, users above in role hierarchy and if it shared using manual sharing.
160.Can you set default access in Organization wide default for detail objects (detail object in case of master detail relationship)?
Ans - No, Detail object will always have default access as 'Controlled by Parent' and it cannot be changed.
161. Can you create sharing rules for detail objects?
Ans - No, this cannot be done.
162. Can standard object appear as detail object?
Ans - No, you cannot have standard object as detail object in case of master detail relationship.
163. What are the differences between list and set?
Ans- 1. Set stores only unique elements while list can store duplicates elements
2. elements stored in list are ordered while those stored in set are unordered.
164. What various default accesses are available in OWD?
Ans - Private, Public Read only, Public read write, Public read write transfer, controlled by parent, Public full access
OWD is the default access level on records for any object in sales force.
For custom objects we can see below access levels -
By default after creating custom object OWD access level is Public Read/Write.
Private: only owner and above hierarchy users can have Read/Write access and below hierarchy users don't have any access.
Public Read only: only owner and above hierarchy users can have Read/Write access and below hierarchy users can have only Read Only.
Public Read/Write: Irrespective of role hierarchy every one can have Read/Write permissions on the records.
165. What are the different types of reports in salesforce?
Ans - tabular,summary,matrix and joined
166. Can a user not have a role?
Ans - Yes, this is possible, Role is not mandatory for user.
167. Can a user not have a profile?
Ans - No, a user should always have a profile. Profile is mandatory unlike role.
168. How many custom fields can be created on a object?
Ans - Initial limit is of 500 fields and if needed this can be extended to 800 by raising a case with salesforce.
169- How to minimize heap size?
Ans- Don't use class level variables to store a large amounts of data.
Utilize SOQL For Loops to iterate and process data from large queries.
Construct methods and loops that allow variables to go out of scope as soon as they are no longer needed.
Reduce heap size during runtime by removing items from the collection as you iterate over it.
Use the 'Transient' keyword with variables. It is used to declare instance variables that cannot be saved, and shouldn’t be transmitted as part of the view state for a Visualforce page.
170- What is session Id?
A session ID is a unique number that a Web site's server assigns a specific user for the duration of that user's visit (session).
The session ID can be stored as a cookie, form field, or URL (Uniform Resource Locator)
1)Briefly explain about yourself?
2)What is salesforce architecture?
3)What all the services provided in cloud computing?
4)what all the services that salesforce supports?
5)what is the difference between profiles and roles?
6)what are web services? why we need to go for them? What is WSDL? What is SOAP?
7) Here you attended capgemini written test. If you got selected here you will be sent to technical round..if you got selected in technical round then you will be sent to HP for client interview, because HP is client to capgemini. If you got selected finally.Then you will be put into work. This is the scenario. which process do you apply here either "WORKFLOWS" or "APPROVALS".(I said approvals,i don't know whether it's correct or not).
8)How can you say that it's "APPROVAL"? (i said first we need to be approved in first round then only we will be sent to the next).
9) How you will make a class available to others for extension? (Inheritance concept)
10) In the process of creating a new record, how you will check, whether user has entered email or not in the email field of Account object?
11)How you will write a java script function that display an alert on the screen?
12)What is the value of "renderas" attribute to display o/p in the form of Excel Sheet?
13)How you will get the java script function into Visual-force page?
14)Can we create a dashboard using Visual-force page? and what all the components we use here?
15)What are web tabs?
16)How you will add an attachment from VF page? tell me the component names to achieve this functionality?
17)Security(OWD, Sharing Rules,Manual Sharing).
18)Rate yourself in salesforce?
19)what is your current package?
20)How much you are expecting?
21)You will be given pen and paper, they will ask you to write some simple code.
Accenture Interview Questions
1) What is Dynamic Approval process?
Ans: Dynamic approval routing allows you to specify the approvers for each record using User lookup fields on the record requiring approval. The fields are populated using Apex, using data from a special custom object (the "approval matrix") that contains all the information needed to route the record. The approval process then uses the values in the lookup field, rather than the limited pool of users available in the so-called static process. This provides more flexibility: you could route to different people based on region or some other criteria related to the record, rather than having to write multiple static approval processes in order to perform the same functionality.
2) Flow of execution in validations, triggers & workflows?
Ans: all before triggers, Validations, Workflows, All after triggers.
3) Assignment process & validations.
4) Difference between Trigger.new & Trigger.old?
5) Trigger events? & context variables?
6) Batch Apex?
Ans: Process large no. of records
7) Will one workflow effects another workflow?
Ans: Yes, update field, Re evaluate checkbox true
8) Syntax for upsert & undelete trigger & Purpose undelete?
9) Case management?
Ans : Assignment Rule, Auto Response Rule, Escalation Rule
10) If we want to upload data through DataLoader, what the changes to be done?
Deloitte F2F Interview Question
1. We have 3 objects Account, Contact, Opportunity. In a VF page, we need to display the names of contact & Opportunity which are related to Account.
2. One object (s1) & 3 tasks (t1, t2, t3) are there. Each task performing discount related stuff. Write a trigger that should calculate the sum of 3 tasks. And if any task is modified than trigger should fire automatically & perform the same.
Ans: List listof tasks = [select id, name from Task where whatId=Trigger.new];
3. How can you convert a lead?
4. What is your Role in your project?
5. Explain 2 VF pages developed by you?
6. How will you deploy? Have you ever involved in deployment?
7. How will you test your code through Sandbox?
8. What is the custom settings ?
9. Difference between SOSL and SOQL in Salesforce ?
10. Custom settings?
11. What is Sales cloud & Service cloud?
12. can a Checkbox as controlling field?
13. Sharing Rules?
14. SOQL & SOSL? Diff between SOQL & SOSL?
15. Difference b/w External ID & Unique ID?
16. What is System.RunAs ()?
17. Explain Test.setPage ()?
18. Why Governor Limits are introduced in Salesforce.com?
TCS F2F interview
1. About project?
2. What are standard objects used in your project?
3. Call outs?
4. Governor Limits?
5. Relationships
6. Different types of field types?
7. Data Migration?
8. Roll-up summary?
9. What is the difference between sales cloud & service cloud?
FIS, Salesforce, KPIT, AON, Xerox Interview Questions
Name three Governor Limits. -- Sosl 20, Soql 100-200, DML 150, Callout 100, time 120 sec, cpu time 10000milisec, 60000msec,future method 50
When do you use a before vs. after trigger?
What’s the maximum batch size in a single trigger execution? 200
What are the differences between 15 and 18 digit record IDs?
Provide an example of when a Custom Setting would be used during development.
When should you build solutions declaratively instead of with code?
Give an example of a standard object that’s also junction object.
Describe a use case when you’d control permissions through each of the following:
– Profiles
– Roles
– Permission Sets
– Sharing Rules
When should an org consider using Record Types?
What are some use cases for using the Schema class? PIcklist values, All objects
A trigger is running multiple times during a single save event in an org. How can this be prevented? Boolean static variable
Why is it necessary for most sales teams to use both Leads and Contacts? So to access any of the personal contact information that was captured on lead records, sales team use the contact record
What is the System.assert method and when is it commonly used? To check expecting value and current value in test class
What are the differences between SOQL and SOSL?
Order the following events after a record is saved:
– Validation rules are run
– Workflows are executed
– “Before” triggers are executed
– “After” triggers are executed
What is Trigger.old and when do you normally use it? To change the value before save
When should you use a lookup instead of a master-detail relationship? If Relationship is not required
What are the advantages of using Batch Apex instead of a trigger? Toprocess large no of records
What are the pros and cons when using a Workflow Rule Field Update vs. a Formula Field?
What are the differences between a Map and a List? Key value pair, order collection of objects
What are the advantages of using Batch Apex instead of a trigger?
Describe a use case for Static Resources. use image and stylesheet in vf page
Provide an example of when a Matrix report would be used. How about a Joined report?
A group of users must be prevented from updating a custom field. What’s the most secure method of preventing this? Sharing Rule
When would you use the @future annotation?
List three different tools that can be used when deploying code. Change set, Eclipse, ANT(Another Neat tool)
When should an Extension be used instead of a Custom Controller? use standard functionaliy and extends new actions
What are the advantages of using External Id fields? Use for Upsert using data loader
What are the uses of the tag? Call action method from javascript code
What are the differences between static and non-static variables in Apex?
What are some best practices when writing test classes? Cover all conditions, use system. asset method
What does the View State represent in a Visualforce page?
What are three new features in the most recent Salesforce release?
Ans: Spring 17 1)You can now create Apex classes that extend System.Exception in the Developer Console. Previously, creating classes whose names contained Exception resulted in an error. This change applies to both Lightning Experience and Salesforce Classic.
2)You can now view all your code coverage results in the Developer Console, even when you have more than 2,000 Apex classes and triggers. Previously, the Developer Console displayed only up to 2,000 rows of code coverage results. This change applies to both Lightning Experience and Salesforce Classic.
3)Only One Test Setup Method per Class is Allowed(previous multiple allowed)
DynamicPicklist Class
The new VisualEditor.DynamicPicklist class is used to display the values of a picklist in a Lightning component on a Lightning page.
Describe the benefits of the “One Trigger per Object” design pattern.
Write a SOQL query that counts the number of active Contacts for each Account in a set.
Declaratively create logic in your org that prevents two Opportunities from being created on a single Account in a single day.
Declaratively create logic in your org that prevents closed Opportunities from being updated by a non System Administrator profile.
American Express F2F Interview Questions
1) Trigger should perform based on user requirement?
It should Trigger when user want to trigger & shouldn’t when trigger don’t want?
2) What are default methods for Batch Apex?
Ans: start(), execute() and finish()
3) Analytical snapshot?
4) Types of Triggers?
5) Other than Data Loader any other way to import Bulk Data?
6) Explain any scenario occurred you to work beyond Governor Limits?7) How u will do Mass Insert through trigger?
8) If I want to Insert, Update any record into ‘Account’. What trigger I have to use?
1. When Workflow limit has over in your Salesforce organization, what are all the alternatives for workflows?
Triggers
Schedulable class
2. Is it possible to write test classes for your triggers?
Yes.
3. If you want to write a workflow for a record in which age should be greater than 18 and it should be a new record. The workflow should not fire for old records. How will you achieve this?
It can be achieved throught IsNew() and age>18 condition in Workflow.
4. If an user is saying that he is unable to login into Salesforce, how will you troubleshoot his login issue?
Login history.
5. Where Roll-up summary field will be there and when it can be used?
Roll-up summary field is applicable only in Master-Detail relationship and it will be present in parent object.
6. Have you used Data loader? If yes, how many records have you migrated to the maximum?
7. What is the difference between Queue and Public Group?
8. If an user is not able to view Reports and Dashboards, how will you provide access to him to Reports and Dashboards?
Create and Customize Reports and Manage public Reports permissions in Profile.
Will update more scenario based questions soon!!!
20) Explain what is Audit trail?
Audit trail function is helpful in knowing the information or track all the recent setup changes that the administration does to the organization. It can store last 6 months data.
QUESTIONS ON PROFILES,PERMISSION SET,USERS,OWD,ROLES AND SHARING RULES IN SALESFORCE
================================
1.What is Profile?
ANS: Profile contains set of permissions and access settings that controls what user can do with in the organization.
2. What are permission sets?
ANS: A set of permissions is given to the users without changing the profile.
3.What is OWD?
ANS: OWD'S are base line record level security for objects in the organization.
It is used to restrict access to data.
4.What is Roles?
ANS: A role controls the level of visibility that users have to an organization's data.
5.What is User?
ANS:The people who have authenticated username and password to login to the salesforce successfully.
6.What is Sharing Rules?
ANS:These are used to override the OWD permissions.
Sharing rules are two types
1.Based on record owner
2.Based on criteria.
7.What is the role hierarchy?
ANS:Role Hierarchy states that higher hierarchy person can see lower hierarchy person records.
8.Can you override profile permissions with permission sets(i have defined some permissions in profile,i am trying to use permission sets for
the same object,can i override permissions for a particular object in the permission sets over to the profile?
ANS:No. Permission Sets are used only to extend the Profile permissions. It never overrides.
9. I want to have read/write permission for User 1 and read only for User 2, how can you acheive?
ANS:Create a Permission Set with read/write and assign it to User 1.
10. I have an OWD which is read only, how all can access my data and I want to give read write access for a particular record to them,
how can i do that?
ANS:All users can just Read the record.
Create a Sharing Rule to give Read/Write access with "Based on criteria" Sharing Rules.
11.What is the difference between role hierarchy and sharing rules?will both do the same permissions?
ANS:Role Hierarchy states that higher hierarchy person can see lower hierarchy person records.
Sharing Rule is used to extend Role Hierarchy.
12. Is it possible to delete the user in salesforce?
ANS:No, once we create an user in salesforce we cannot delete the user record. We can only deactivate the user record.
13.How to provide security for Meta-Data files (Schema)?
ANS:Using Profiles and Permission Sets.
13. How to give permissions to two fields for different users who belongs to different profiles?
ANS:Permission set
14.What is Grant Access Using Hierarchies?
ANS:In OWD we have Private but your higher position persons should see that time we go for Grant Access Using Hierarchies.
15. How we can change the Grant access using role hierarchy for standard objects?
ANS:Not possible.
16.What is manual sharing?
ANS:Manual sharing is to share a record to a particular user manually.
Go to detail page of record and click on manual sharing button and assign that record to other user with Read or Read/Write access.
Manual Sharing button enables only when OWD is private to that object.
17.Can you tell the difference between Profile and Roles?
ANS:Profiles are used for Object level access settings.
Roles are used for Record level access settings.
=========================================
QUESTIONS ON TRIGGERS IN SALESFORCE
=========================================
1.What is trigger ?
Ans: Trigger is piece of code that is executes before and after a record is Inserted/Updated/Deleted from the force.com database.
Owner Change and Roll up summary fire the trigger and workflow Rule but Formula not.
Add Error work only before insert and before updates and before delete
Trigger.old --- Read Only
Before Insert -- Change value only, Update and delete DML is not allowed(Original object is not Created).
After Insert, After Undelete ----Value Can't change(Runtime Exception),Update and Delete(useless after insert object is deleted) allowed(Get the object on id basis and update and delete it).
Before Update --- Change Value only, DML Not allowed (Update,Delete,Both Trigger.new and Trigger.old).
After Update ----Value Can't Change(Runtime Exception),Update and delete allow if we manage recursive trigger.
Before Delete---Value can't change(Trigger.new is not available), Delete not allowed, Update allow
After Delete---Value can't change(Trigger.new is not available). Update and delete not allowed(Because object is already deleted)
upsert triggers fire both before and after insert or before and after update triggers as appropriate.
merge triggers fire both before and after delete triggers for the losing records and before update triggers for the winning record only.
Field history is not recorded until the end of a trigger. If you query field history in a trigger, you don’t see any history for the current transaction.
All triggers are bulk triggers by default, and can process multiple records at a time
2.What are different types of triggers in sfdc?
Ans: 1.Before Triggers - These triggers are fired before the data is saved into the database.
Before triggers are used to update or validate record values before they’re saved to the database.
2.After Triggers - These triggers are fired after the data is saved into the database and used to access field values that are set by the system(id, LastModifiedDate).
For work on child records
3. What is the Syntax of trigger?
Ans. Trigger Syntax :trigger TriggerName on ObjectName (trigger_events) {
code_block
}
The code block of a trigger cannot contain the static keyword. Triggers can only contain keywords applicable to an inner class.
3.What are trigger context variables?
Ans: Allow developers to access run-time context. These variables are contained in the System.Trigger class.
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.
4.What is the difference between Trigger.New and Trigger.NewMap?
Ans:Trigger.New is Returns a list of new version of sObject records but Trigger.NewMap is Returns a map of new version of sObject records.
5.What is the difference between Trigger.New and Trigger.Old?
Ans:Trigger.New is Returns a list of new version of sObject records and Trigger.Old is Returns a list of old version of sObject records.
6.What is the difference between Trigger.New and Trigger.Old in update triggers?
Ans: Trigger.new contains the new value after updating the records and Trigger.old contains the old value after updating the records in update trigger.
7.Can we call batch apex from the Trigger?
Ans: A batch apex can be called from a class as well as from trigger code.
In your Trigger code something like below :-
// BatchClass is the name of batchclass
BatchClass bh = new BatchClass();
Database.executeBacth(bh);
8.What are the problems you have encountered when calling batch apex from the trigger?
Ans: Batch will fire for every operation in each context.
9.Can we call the callouts from trigger?
Ans: 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
10.What are the problems you have encountered when calling apex the callouts in trigger?
Ans: Direct Callout is not allowed in trigger always use @future method.
11.What is the recursive trigger?
Ans: 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)
12.What is the bulkifying triggers?
Ans: 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.
(Exa: Data Import, Mass delete,update recod owner).
Minimize the number of DML operations
Minimize the number of SOQL statements
13.What is the use of future methods in triggers?
Ans: Using @Future annotation we can convert the Trigger into a Asynchronous Class and we can use a Callout method.
14.What is the order of executing the trigger apex?
Ans:
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.
15.What is the trigger handler?
Ans: Trigger Handler is an apex class and we can call this class method form trigger that implements all the logic here.
16.How do we avoid recursive triggers?
Ans: Use a static variable in an Apex class to avoid an infinite loop. Static variables are local to the context of a Web request.
public class AccountProcessor{
public static boolean Firstrun= true;
}
17.How many triggers we can define on a object?
Ans: We can write more than one trigger But it is not recommended .Best practice is One trigger On One object.
18.Can we define triggers with same event on single object?
Ans:Yes, But order of execution not sure
19.How many time workflow field update will be called in triggers?
Ans: one times
20. Best Practice of apex code?
Ans. Bulkify your Code
Avoid SOQL Queries or DML statements inside FOR Loops
Using Collections
Avoid Multiple Triggers on the Same Object
Querying Large Data Sets
Use of the Limits Apex Methods to Avoid Hitting Governor Limits
Avoid Hardcoding IDs
Writing Test Methods to Verify Large Datasets
Use @future Appropriately
21. There is a validation rule which will fire if amount = 100 and will display the error message. There is a workflow rule which will fire
if amount > 100 and will update amount field to 100. One of user saved the record by giving value as 1000.
what will the value of the amount field.
Ans. Validation rules will fire first then workflow rules will fire. So, the answer is 100 (Even though there is a validation rule because of the workflow rule it will accept 100 in the amount field).
=========================================
QUESTIONS ON BATCH APEX IN SALESFORCE
=========================================
1.What are the soql limitations in apex?
Ans: Total number of records retrieved by SOQL queries-50,000
2.What are the transaction limitations in apex?
Ans: 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.
3.What is the need of batch apex?
Ans: By using Batch apex classes we can process the records in batches in asynchronously.
4.What is Database.Batchable interface?
Ans: The class that implements this interface can be executed as a batch Apex job.
5.Define the methods in batchable interface?
Ans:
Start:
global Database.Querylocator start (Database.BatchableContext bc){}
Execute:
global void execute(Database.BatchableContext bc,List ){}
Finish:
global void finish(Database.BatchableContext bc) {}
6.What is purpose of start method in batch apex?
Ans: It collect the records or objects to be passed to the interface method execute.
7.What is the Database.QueryLocator?
Ans: 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).
8.What is the iterable
Ans: If you use an iterable,
the governor limit for the total number of records retrieved by SOQL queries is still enforced.
9.What is the use of execute method?
Ans: Contains or calls the main execution logic for the batch job.
10.How many times execute method is called?
Ans: Execute method is called for each batch of records.
11.What is the scope of execute method?
Ans: The maximum value for the optional scope parameter is 2,000
12.Can we call callouts from batch apex?
Ans: Yes we can call.
13.Can we call another batch apex from batch apex?
Ans: Yes you can call a batch apex from another batch apex .Either in start method or in finish method you can call other batch
14.How many callouts we can call in batch apex?
Ans: Batch executions are limited to one callout per execution.
15.Batch is synchronous or Asynchronous operations?
Ans: Asynchronous operations.
16.What is the maximum size of the batch and minimum size of the batch ?
Ans: The default batch size is 200 records. min?
max?
17.What is the Database.BatchableContext?
Ans: 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.
18.How to track the details of the current running Batch using BatchableContext?
Ans: You can check the AsyncApexJob.Status using the JobId from the Database.BatchableContext.
19.How many batch jobs can be added to queue?
Ans: Queued counts toward the limit of 5.
20.What is Database.State full interface?
Ans:To maintain variable value inside the Batch class, Database.Stateful is used.
21.What is Database.AllowCallouts?
Ans:
To use a callout in batch Apex, you must specify Database.AllowsCallouts in the class definition. For example:
global class SearchAndReplace implements Database.Batchable
Database.AllowsCallouts{
//Business logic you want by implementing Batchable interface methods
}
Callouts include HTTP requests as well as methods defined with the webService keyword.
22.What is AsyncApexJob object?
Ans: AsyncApexJob is Represents an individual Apex sharing recalculation job.
Use this object to query Apex batch jobs in your organization.
23.When a BatchApexworker record is created?
Ans: For each 10,000 AsyncApexJob records, Apex creates one additional AsyncApexJob record of type BatchApexWorker for internal use.
24. Is it possbile to write batch class and schedulable class in a same class?
Ans. By implementing Database.Batchable and Schedulable interfaces we can implement the methods in a same class.
================================================
QUESTIONS ON WORKFLOWS AND APPROVAL PROCESS IN SALESFORCE
================================================
1. What is work flow ?
Ans: Work flow works based on certain criteria,By using workflow we can automate the business process like Email alerts,tasks,filed updates
2. What are the different kinds of evaluation criteria’s (events)?
Ans: 1.created
2.created, and every time it’s edited
3.created, and any time it’s edited to subsequently meet criteria
3. In which object workflows are stored?
Ans: Workflow
4. What is the difference between Created and everytime edited to meet the criteria and Created and edited to subsequently meet the criteria?
Ans: If we select 'Created and everytime edited to meet the criteria' whenever we create a record or edit a record if the criteria of the workflow rule meets then it will trigger every time. If we select 'Created and edited to subsequently meet the criteria' -
While creating the record criteria meets so that workflow will fire and while editing the record again criteria meets workflow won't fire (meeting the criteria to meeting the criteria)
While creating the record criteria doesn't meet so workflow won't fire and while editing the record workflow criteria meets then workflow will fire (not meeting the criteria to meeting the criteria)
Conclusion: Previous state of record should be not meeting criteria and current state of record should be meeting the criteria then only in current state workflow will fire.
5.What are the types of rule criteria’s?
Ans: 1.Criteria meet (field - operator - value, if there are multiple criteria’s then in filter criteria we can give conditions like ( 1 or 2) and 3, field to field comparison is not possible, we can't fetch the previous state information of the field )
2.Formula evaluated (we can write formulas with this we can do field to field comparison and we can fetch previous state value of the record)
6. What is immediate workflow action?
Ans: The action which will be performed immediately after the record criteria meets.
7. What is time dependent workflow action?
Ans: The action which will be performed in future based on the any of the date field. To create time dependent workflow action we should create one time trigger. in time trigger we can give either days or hours with the maximum of 999 value and we can select either before or after.
8. For which event we can't create time dependent workflow action?
Ans: Created and everytime edited to meet the criteria.
9. What are the different kinds of workflow actions?
Ans: New field update (we can update a field of the same object or the fields of the parent objects which are at master side in master-detail relationship, only for master-detail parent objects we can update the field and for lookup we can't update)
New email alert (we can send emails if the criteria meets)
New task (we can create new task)
New outbound Message (we can make a callout)
10. What are the types of email templates?
Ans:1.Text
2.HTML (with letter head)
3.Custom HTML (without letter head)
4.Visual Force
12. How can you monitor future actions of time based workflow?
Ans: setup --> administration set up --> monitoring --> time based workflow
13. There is a timebased workflow which will update one of the fields if the criteria meet. User submits the record with valid criteria,
workflow triggered so that the field update is queued in the 'time based flow' queue which will fire after one day. If the user modifies the
record which is submitted before the scheduled date, after modification, a record criterion is not meeting. Whether the field will be updated
or not in schedule date?
Ans: It won't trigger in the schedule date because if we modify the record to not meeting criteria that queued field update will be removed
from the 'time based flow' queue.
14. For the same scenario explained in the above question what happens when we deactivate or modify the criteria of the workflow to different
criteria? Whether the field will be updated or not in schedule date?
Ans: Yes, It will trigger in scheduled date.
15. Scenario: There are two workflow rules on the same object say namely wf1 and wf2. If wf1 fires then a field will be updated on the same
object, if the field updated and due to this wf2 criteria meets then what will happen, wf2 will fire or not?
Ans: It won't fire. To fire wf2 we should enable 'Re-evaluate Workflow Rules' checkbox of the field update which is there in wf1.
16. What is recursive workflow rule? How to avoid recursive workflow rules?
Ans:Whenever we enable Re-evaluate Workflow Rules after Field Change checkbox in the Field Update of a workflow rule, due to this field update other workflow rules on the same object will be fired if the entery criteria of those workflow rules satisfied.
Incase, in other workflow rules also if we enable Re-evaluate Workflow Rules after Field Change checkbox in the Field Update recursive workflow rules will come in some scenarios.
We can take two steps to avoid recursive workflow rules -
For the workflow Evaluation Criteria if you choose created, and any time it’s edited to subsequently meet criteria option, we can avoid recursive workflow rules.
If you don't enable Re-evaluate Workflow Rules after Field Change checkbox in the Field Update of a workflow rule we can avoid.
17. What is Approval Process?
Ans: If the criteria of the record meets then by clicking on submit for Approval button user can submit the record for approval (Note: Approval history related list should be displayed on the record detail page)
18. Scenario: After activating the approval process, I want to add one more step. Is it possible?
Ans: It’s not possible, to add one more step deactivate the approval process and clone the deactivated approval process and add the new steps.
19.In which object all Approval process are stored?
Ans: Approval
==================================================
QUESTIONS ON REPORTS AND DASHBOARD IN SALESFORCE
==================================================
1. What is Report?
To summarize the information of an object we use reports.
2. What are the types of Reports?
Tabular (Displays records just like a table)
Summary (we can summarize the information based on certain fields)
Matrix (we can summarize the information in two dimensional manner, both rows and columns)
Join (we can summarize information in different blocks on the same object and the related objects)
3. How many blocks we can create for join reports?
5 blocks.
4. How many maximum groupings we can do for summary, matrix and join reports?
3 groupings
5. What is bucketing in reports?
Bucket field in Reports in Salesforce is used to group values to the name we specify.
It can group only the below data types fields
1. Picklist
2. Number
3. Text
6. How many records we can display on page for a report?
We can display up to 2000 records on a page. If more records are there to display we cannot see those through user interface. If you export the records to a excel sheet then you can export all records.
7.Can we mass delete reports using Apex (Anonymous Apex)?
Salesforce has not exposed any API for Reports. So best way is :
Move all reports needs to delete in new folder.
Inform everyone that reports will be deleted after some time may be 30 days.
Import your reports folder in Eclipse including all reports to be deleted and then delete the the reports folder in eclipse. It will delete all the reports at once.
8.Explain what is dashboard?
Dashboard is the pictorial representation of the report, and we can add up to 20 reports in a single dashboard.
9.What are the different Dashboard Components?
Salesforce dashboard components are used to represent data. Salesforce dashboards have some visual representation components like graphs, charts, gauges, tables, metrics and visualforce pages. We can use up to 20 components in single dashboard.
10.Is it possible to schedule a dynamic dashboard in Salesforce?
No, it is not possible to schedule a dynamic dashboard in Salesforce.
11.Which type of report can be used for dashboard components?
Summary and matric report.
12.Explain dynamic Dashboard?
Dynamic dashboards in Salesforce displays set of metrics that we want across all levels of your organization.
Dynamic Dashboards in salesforce are Created to provide security settings for the dashboards in salesforce.com.
We may have a requirement in an organization to “view all data” by every user in an organization according to their access we have to select
Run as Logged-in User. There are two setting option in Dashboards.
They are
1.Run as specified User.
2.Run as Logged-in User.
=====================================================
QUESTIONS ON REST API AND SOAP API IN SALESFORCE
=====================================================
Callout can not perform after dml operation in same transaction
Callout can not perform after dml operation(Future method is called before callout) in same transaction
Callout not stop the execution, i am inserting a record after callout
1.What is SOAP and What is REST?
REST API
Representational State Transfer.
It is based URI
It works with GET,POST,PUT,DELETE
Works Over with HTTP and HTTPS
SOAP API
Simple Object Access Protocol.
It is based on Standard XML format
It is works with WSDL(Web Services Description Language)
Works Over with HTTP,HTTPS,SMPT,XMPP
2.Difference between REST API and SOAP API?
Ans :Varies on records that can be handled. Generally if we want to access less number of records we go for REST API.
3.What is WSDL?
A WSDL is an XML Document which contains a standardized description of how to communicate using webservice.
4.What are the different type of WSDL'S?
Ans:
Enterprise WSDL
Partner WSDL
Apex WSDL
Metadata WSDL
Tooling WSDL
Delegated Atuntection WSDL
5.Difference between Enterprise WSDL and Partner WSDL?
Ans:
Enterprise WSDL:
It is used for building client applications for a single salesforce organization.
Customers who use enterprise WSDL document must download and re-consume it when ever their organization makes a change to its custom objects or fields or when ever they want to use a different version of the API.
Partner WSDL:
It is used for building client applications for multiple organizations.
The partner WSDL documention only needs to be downloaded consumed once per version of the API.
6.How can you expose an apex class as a REST web service in salesforce?
Ans - An apex class can be exposed as REST web service by using keyword '@RestResource'
7.How to fetch data from another Salesforce instance using API?
Ans :Use the Force.com Web Services API or Bulk API to transfer data We this this is a great job for the Bulk API.
8.How to call Apex method from a Custom Button?
Ans :An Apex callout enables you to tightly integrate your Apex with an external service by making a call to an external Web service or sending a HTTP request from Apex code and then receiving the response.
Apex provides integration with Web services that utilize SOAP and WSDL, or HTTP services (RESTful services).
9.What is the use of Chatter REST API?
The Chatter API (also called Chatter REST API) lets you access Chatter information via an optimized REST-based API accessible from any platform. Developers can now build social applications for mobile devices, or highly interactive websites, quickly and efficiently.
10.How to fetch data from another Salesforce instance using API?
Answer: Use the FORCE.COM WEB SERVICES API or BULK API to transfer data We this this is a great job for the Bulk API.
11.What are callouts and call ins?
Making a request to an external system from salsforce is callout.
Getting requests from an external system is a call in.
12.How many callouts to external service can be made in a single apex transaction?
Ans - A total of 10 callouts are allowed in a single apex transaction.
13.What is the maximum allowed time limit while making a callout to external service in apex?
Ans - maximum of 120 second time limit is enforced while making callout to external service
14.What is the default timeout period while calling webservice from Apex.
Ans : 10 sec.
15.can we define custom time out for each call out?
Ans :
A custom time time can be defined for each callout.
the minimum time is 1 millisecond and maximum is 120,000 milli seconds.
16.How to increase timeout while calling web service from Apex ?
Ans :
docSample.DocSamplePort stub = new docSample.DocSamplePort();
stub.timeout_x = 2000; // timeout in milliseconds
17.What is the use of JSON?
================================
================================
1. For which criteria in workflow "time dependent workflow action" cannot be created?
Ans: created, and every time it’s edited (Why Reason: if we edit record for other field again time Based workflow fire unnecessarily)
2. What is the advantage of using custom settings?
Ans : You don't have to query in apex (fire select query) to retrieve the data stored in custom
settings.
List Custom Settings
A type of custom setting that provides a reusable set of static data that can be accessed across your organization.
Data in list settings does not vary with profile or user, but is available organization-wide.
Hierarchy Custom Settings
The hierarchy logic checks the organization, profile, and user settings for the current user and returns the most specific, or “lowest,” value.
3. What are the different workflow actions available in workflows?
Ans: 1. Field update 2. Email alert 3. send Outbound messages 4. Create new task
4. What is whoid and whatid in activities?
Ans: Whoid is the id of either contact or Lead. Whatid is the id of the related to record in
activity record(standard or custom object)
5. What is the difference between a standard controller and custom controller
Ans: standard controller inherits all the standard object properties, standard button
functionalities can be directly used. Custom controller defines custom functionalities,
a standard controller can be extended to develop custom functionalities using keyword "extensions"
6. Can you have more than one extensions associated with a single page?
Ans : Yes we can have more than extensions.
7. If page is having multiple extensions and if two extensions have methods of same name.Then which method out of these two will be called upon
calling from vf page ?
Ans: The one which is present in the controller defined on the left side will be called.
8. What are governor limits ?
Ans: Governor limits are the limits imposed by salesforce so as to avoid monopoly by orgs in using salesforce shared resources.
9. How can we implement pagination in visualforce ?
Ans: use standardset controllers for implementing pagination.
10. What is the difference between force.com and salesforce.com?
Ans: force.com is paas(platform as a service) and salesforce.com is Saas(software as a service)
11. What is a externalid in salesforce?
Ans: It is a field which can be used to store a value that is used as a reference for that record in other system.
For example if you have a record in system 'xyz' where it is referenced by some value then that value can be used as external id in salesforce for that record.
External id can be used for upsert operation in data loader.
12. What happens upon lead conversion ?
Ans: When lead is converted a contact(Lead Name), account(Company Name) and optionally an opportunity is created.
13. What are different ways of deployment in salesforce ?
Ans: Change sets, eclipse and ANT(Another Neat Tool)
14. How can you override a list button with a visuaflorce page?
Ans: Visualforce page should be a list controller that is it should have "recordsetVar" attribute defined in page tag.
15. Is it possible to bypass Grant Access Using Hierarchies in case of standard objects ?
Ans : No. This is default and cannot be changed.
16. How can you call a controller method from java script ?
Ans: Use action function component to call controller method from java script.
17. How can you call a visualforce page from a controller method?
Ans: Use pagereference object for calling a visualforce page from controller method.
18. How can you sort a select SOQl query ?
Ans: use order by clause in select query for sorting a list of records.
19. How much code coverage is needed for deployment?
Ans : Each trigger should have minimum of 1%. Class can have 0%. But, the total code coverage of 75%.
20. Can 'set' store duplicate values in it?
Ans : No. Set only stores unique values. List can have duplicate values in it.
21. Can two users have same profiles?
Ans: Yes
22. How can you refresh a particular section of a visualforce page?
Ans: This can be done using reRender attribute
23. How can you create a many to many relationship in salesforce?
Ans: This can be done by creating junction object between the two objects.
24. What happens to detail record when a master record is deleted?
Ans: detail record gets deleted.
25. What happens to child record when a parent record is deleted(look up relationship)?
Ans. Child record will not be delete
26. How to get current logged in users id in apex ?
Ans: Use Userinfo.getuserid() to get the current logged in user's id in apex.
27. How to convert a csv file browsed in visualforce page into a string?
Ans: use csvfilecontents.tostring(). method to convert blob to string
28.How many records can a select query return ?
Ans : As of now it can return upto 50000 records.
29. How many records can a sosl query return ?
Ans: as of now it can return upto 2000 records
30. How to fire dynamic query in soql?
Ans: Using database.query
Example: List accList = Database.query('select name from account');
31.What is a bucket field in reports?
Ans: This field is used for custom grouping of values in a field. This can be used in summarizing the report.
32. What are dynamic dashboards ?
Ans: Dashboards which run for logged in user are dynamic dashboards
33. Can the dynamic dashboards be scheduled?
Ans: No they cannot be scheduled.
34.How can you use custom label; in visualforce page?
Ans: Use this syntax for accessing custom label in visualforce page - {!$Label.Samplelabel}
35.What are the types of custom settings in salesforce?
Ans: List type and Hierarchy type
36.What are the different types of collections in apex?
Ans: There are three types of collections in apex language
1. Set
2. List
3. Map
37. What are maps in apex?
Ans: Map has keys and values. A key points to a single value. Map can be used to store relationship between two entities. Keys in map are
unique. Values can be duplicated.
38. What are the different types of object relations in salesforce ?
Ans: 1. Look Up(1:N)
2. Many to many
3. Master detail
39.Can you have roll up summary fields in case of parent child relationship?
Ans: No. These are present only in case of master details relationship.
40. Can you see a lead which is converted in saleforce UI?
Ans: The detail record is not seen. But a page, wherein it shows the links for formed account, contact and opportunity.
41. What is the difference between action function and action support ?
Ans: Action functions can call controller method from java script, action support adds support to other components.
42. What is action poller in visualforce ?
Ans: Action poller sends AJAX request with a specified time interval.
43. What are the different types of reports available in salesforce?
Ans: 1. tabular report
2. Summary Report
3. Matrix Report
4. Joined Report
44. How many active assignments rule can you have in lead/Case?
Ans: You can have only one active assignment rule at a time.
45. How do we access static resource in visualforce?
Ans: Use this syntax for accessing static resource {!$Resource.Testresourcename}
46. How to embed a visualflow in a visualforce page ?
Ans: Use this syntax to embed flow in vf page :
47. How to enable inline editing in visauflorce page ?
Ans You can enable inline editing in visualforce page by using component.
48. What is trigger.new in trigger ?
Ans: trigger.new is a list of records that are in the context of trigger or becuase of these records(modification,Creation, deletion) the trigger has been called
49. How do we bulkify the trigger ?
Ans: Bulkfification requires iterating over all the records in trigger context
for example : for(account ac: trigger.new){
// your logic here
}
50.How can we get the old value in trigger ?
Ans: use trigger.old map for getting previous values of fields.
51. Can we modify records directly in trigger.new ?
Ans: trigger.new is a read only list, but field values can be changed in case of before trigger.
52. What does the error "list has no rows for assignment" mean?
Ans: it means the list you are trying to access has no values in it.
53. Why should we not write select query within for loop?
Ans: Writing select query within for loop may hit the governor limit of 100 select queries.
54. What should we do to avoid view state error in visualforce page?
Ans: Clear unused collections, define variable as transient.
55. What is a sandbox org?
Ans: It is the exact copy of your production org.
56.What is sosl?
Ans: select query that can return records of multiple objects as list of lists.
57. How many records a select query soql can return?
Ans: as of now the limit is 50000
58. What is the full form of AJAX?
Ans: it stands for asynchronous java and XML
59. Why do we need to write test classes?
Ans: Salesforce does not allow deployment in production if the test coverage is less than 75%
60.How can you show a custom error message in trigger?
Ans: This can be done using addError() method in trigger
61. What is the use of future annotation?
Ans: Future method starts execution when Salesforce has resources available.That is for asynchronous execution.
62. How to identify if a class is a test class?
Ans: test class always begins with @isTest
63. How to convert a blob variable into a string?
Ans:Use toString to convert blob into string
64. what are the different methods of batch apex class?
Ans: start method, execute method and finish method
65.What is' with sharing' in apex class code?
Ans: When you use 'with sharing', user's permissions and field-level security are respected. In case of 'without sharing' code runs in system mode.
66. How many records can a sosl return ?
Ans: It can return 2000 records as of now as per governers limit
67.Can you use dml statement in visualforce component controller ?
Ans: To use dml in visualforce component you have to declare allowdml=true in visualforce component otherwise you will get an exception
"DML is currently not allowed"
68. Can you write sosl in trigger>?
Ans: Earlier this was not allowed but now sosl are allowed in triggers.
69. Which are the different access modifiers in apex?
Ans: 1. Private 2. Public 3. Protected 4.Global are the four access modifiers allowed in apex.
70. Can you change the master of a detail record in salesforce ?
Ans. Yes provided you have ticked marked "Allow reparenting" in field setting otherwise the field is read only and master cannot be changed.
71. How can you lock records in apex?
Ans: use For update in query to lock the record. For example: [select id,name from contact limit 10 For update];
72. Is there any limit on the number of items that can be stored in apex collections?
Ans: There is ni such limit but we need to consider heap size limit 6mb (6 MB as of now)
73. How can you monitor future actions of time based workflow?
Ans: setup --> administration set up --> monitoring --> time based workflow
74. What is visualforce component ?
Ans: It is a piece of code that can be reused. It can be encapsulated in other visualforce pages.
75. How can you display the status of an AJAX update request in a visualforce page ?
Ans: To display AJAX request status we can use component actionstatus.
76. How can you access custom label in apex:
Ans: Example --> string custLabelstr = System.Label.LabelNamehere
77.How can you get all the keys of a map variable ?
Ans: USe method keyset() for this
Example = Set idSet = mapname.keyset();
78. How can you compare values of a picklist field in validation rule?
Ans : for comparing picklist value use ispickval
ISPICKVAL(picklist_field, text_to_compare)
79.What are the different types of sandboxes in salesforce ?
Ans: Developer, Developer Pro, Partial Data and Full are the 4 types of sandboxes in salesforce.
80. With what frequency can you refresh a full copy sandbox?
Ans: full copy sandbox can be refreshed every 29 days from production.
81. How can you make fields required on a visualforce page?
Ans: mark required = true as done in the example below:
82. What is minimum coverage for every trigger for deployment?
Ans: every trigger should have a minimum coverage of 1%. Total coverage should be 75%
83. What is minimum coverage for every class for deployment?
Ans: There is no such requirement. A class can have 0% but the total coverage should be >75%
84. How can you implement custom functionality for a standardcontroller visualforce page?
Ans: This can be done by associating a controller class with that standard controller using "Extenssions"
85. How can you get the current record id in a visualforce page ?
Ans use ApexPages.CurrentPage().getparameters().get('id') to get the current record id in visaulforce page.
86. Can a user change his own profile in salesforce ?
Ans: No, a user cannot change change his own profile !!
87. Can a user change his own role?
Ans: Yes this can be done !!
88. Reset security token option is unavailable in set up. What could be the reason?
Ans: If in the profile setting "login ip ranges" have been set up then the option of "reset security token" is uanvailbale.
89. How can you skip record type selection page(and take up default record type) while creating new record of a aprticular object ?
Ans: just tickmark against the object by navigating to following :
set up --> my personal information -- > Record type selection --> check against the required object
90. What are the different data types that a standard field record name can have?
Ans: Record name field can have either of the two data types : Auto Number or Text data type
91.Can you edit a apex trigger/apex class in production environment ?
Ans: No apex trigger /class cannot be edited in production.
92. Can you edit a visualforce page in production environment ?
Ans: Yes this can be done.
93.How can you deliver a visualforce page in excel form ?
Ans: use contentType="application/vnd.ms-excel#Contacts.xls" in page component of visualforce page
94. What is trigger.new?
Ans: It is a list of records in current context in a trigger.
95. What does it mean when you get the error "too many soql queries 101 salesforce"?
Ans: It means you are hitting the limit of 100 soql queries as per governers limit
96. How can you create a input field for date on a visualforce page ?
Ans: To create a input date field on vf page you will have to bind it with a existing date field on any object.
97. How can you convert a text to upper string ?
Ans: stringname.toUppercase();
98. How can you convert a integer into a string ?
Ans: string.valueof(integerName);
99. What are the different types of email templates that can be created in salesforce?
Ans: Test, HTML (using Letterhead), Custom (without using Letterhead) and Visualforce.
100. How can you display different picklist values for picklist fields in different page layouts?
Ans: This can be done using record types.
101.Can you do a dml in constructor?
Ans: No this cannot be done.
102. What are the data types that can be returned by a formula field?
Ans: 1.Checkbox 2. currency 3.Date 4.Date/Time 5.Number 6.Percent 7.Text
103. Can you create a new profile from scratch ?
Ans: No, you have to clone from a existing profile and modify the settings as required.
104. What are custom labels in saleforce?
Ans custom labels are custom text values that can be accessed from apex codes and visualforce pages.
105. What is the character limit of custom label ?
Ans: Custom labels can be only 1000 characters long, not more than that.
106. How long can a sandbox name be?
Ans: It can only be of upto 10 characters not more than that.
107. Can you use sharing rules to restrict data access?
Ans No, sharing rule can only give wider access to data it cannot restrict data access.
108. Can you edit a formula field values in a record?
And: formula fields are read only and cannot be edited.
109. Can you edit roll up summary field values in a record?
Ans: No, roll up summary fields are read only and cannot be edited.
110. How can you create relationship between two objects in salesforce?
Ans relationship can be set up by crating either look up relationship field or master detail relationship fields on objects.
111. Can you create a roll up summary field on parent object?
Ans: Roll up summary fields can only be created if the relationship between objects is master detail type.
112. How can you place an entire visualforce page in a different visualforce page?
Ans - This can be done using include attribute.
113. How can you hard delete records in apex?
Ans - use emptyrecyclebin method as below
ex- delete myAccList;
DataBase.emptyRecycleBin(myAccList);
114. What all data types can a set store?
Ans - A set can store all primitive data types and sObjects but not collections.
115. What is the use of offset keyword in a soql query?
Ans - Using offset keyword return the records starting from desired location in the list. For example if we specify offset 8 then all the records starting from location 9 onwards would be returned.
116. How can you display an image as an field in a detail page of record?
Ans - This can be done using IMAGE function. A url of the image stored in document should be given in image function
117. When a lead is converted into account/contact will the trigger on account/contact fire?
Ans - In set up we can enable or disable whether triggers should run on conversion.
118. What happens to contacts when an account is deleted?
Ans - When an account is deleted all the contacts under it gets deleted.
119. What is an sObject type?
Ans - sObject refers to any object that can be stored in force.com platform database. ex. sObject s = new contact()
120. How many elements can be stored with in a collection(list,set,map)?
Ans - There is no limit on the number of elements that can be stored in a collection. However, we need to consider the heap size limit.
121.Expand SOQL and SOSL.
Ans - SOQL- salesforce object query language, SOSL - salesforce object search language.
122. What is the difference between soql and sosl?
Ans - SOQL can query records from a single object at a time, while sosl can query records from
multiple objects. SOQL returns a list while SOSL returns list of lists.
123. How can you query all records using an soql statement?
Ans - This can be done using ALL ROWS keyword. This queries all records including deleted records in recyclebin.
124. What is the use of @future annotation?
Ans - Using @future annotation with a method executes it whenever salesforce has resources available.
125. What are the different access modifiers that can be used with methods and variables?
Ans - Global, Public, private and protected
126. What is the significance of static keyword?
Ans - Methods, variables when defined as static are initialised only once when class is loaded.
Static variables are not transmitted as part of view state for a visualforce page.
127. Can custom setting be accessed in a test class?
Ans - Custom setting data is not available default in a test class. We have to set seeAllData parameter true while definig a test class as below.
@isTest(seeAlldata=true)
128. What is the difference between role and profile?
Ans - Role defines record level access while profile defines object level access.
129. On which objects can you create Queues?
Ans - Queues can be created on two standard objects (Lead and case) and also on all custom objects.
130. What are the different ways to invoke apex code?
Ans - Apex code can be invoked using DML operation(trigger), Apex class can be scheduled using schedulable interface(ex. batch apex),
apex code can be run through developer console, an apex class can be associated with a visualforce page.
131.Can you create sharing rules for detail objects?
Ans - No. Detail objects cannot have sharing rules as the detail objects do not have owner field with them.
132. How can view state error be avoided?
Ans - Use transient keyword with variables wherever possible, clear unused collections. Use 1 form tag in a visualforce page.
133.Consider that a record meets a workflow criteria for time based workflow action, the action goes in queue . Later, before the time based
action is triggered, the same record gets modified and the criteria previously met is changed and now it does not meet the workflow criteria, what happens to the time based action placed in queue?
Ans - The time based workflow action is removed from the queue and will not get fired.
134. What is the use of writing sharing rules?
Ans - Sharing rules extend the record/data access level which is set using OWD, role hierarchy.
Sharing rule cannot restrict the data visibility but can only widen it.
135. Which all field data types can be used as external ids?
Ans - An external id can be of type text, number or email type
136. What is a mini page layout?
Ans - Mini page layout defines fields and related list to be displayed in hover detail and console tab.
Whenever you hover mouse over any recently viewed record the fields are displayed, related list is
not displayed(fields can be set in mini page layout).
Console tab fields and related list on the right hand side are also controlled by mini page layout.
137. What is the use of console view/console tab?
Ans - Console gives list views and related list records for multiple objects on a single
screen without any customization (visualforce page or controller)
138.What is @future annotation in apex?
Ans - It is used to indicate that code should be executed asynchronously when salesforce has available resources.
139. What are the different considerations that must be followed when using @future annotation in apex method?
Ans - 1. Method must be static 2. It must return void and 3. method can have argument of type primitives,collection of primitives or arrays of primitives
140. How can you execute batch apex programmatically?
Ans - Batch apex can be invokde using Database.executebatch(). Ex- Id batchprocessId = Database.executebatch(mybatchapexclass,200)
141. How can you set the batch size in batch apex ?
Ans - This can be set using optional scope parameter in database.
executebatch (batchapexname,batchsize) example - Id batchprocessId = Database.executebatch (mybatchapexclass,200) in this example batch size is set to 200
142. How can you monitor batch apex job?
Ans - Batch apex job can be monitored by navigating to your name
--> setup --> monitoring --> Apex jobs
143. What is the difference between List type custom setting and Hierarchy type custom setting?
Ans - List type stores static data that can be used in apex code as it is examples could be country
codes,currencies etc
Hierarchy type stores data that may change depending on user,profile or org wide default
144. Where can custom setting data be accessed?
Ans - Custom setting data can be accessed in formula fields,validation Rule, Visualforce, Apex, and the Force.com Web Services API(Hierarchy type Hide)
145. What different return types can be returned by SOQL?
Ans - A SOQL can return List of objects, a single object or an integer
146.What are the different exceptions in apex?
Ans - Apex exceptions can be built in or we can also create our own custom exceptions.
Exception class is the super class of all the built in exceptions.
So as to create a custom exception the class name should end with string 'exception' and it
should extend any of the built in exception class or other custom exception class.
147. What different access modifiers can be used for apex classes?
Ans - Apex classes can have either or these three access modifiers 1. Private 2. public 3. global
148. What different access modifiers can be used for class members?
Ans - Class members can have any of these four access modifiers 1. global 2. public 3. protected 4. private
149. What are governers limit in salesforce?
Ans - Governers limit are run time limits that are enforced by salesforce.
Governers limits are reset per transaction.
150. What is an apex transaction?
Ans - An apex transaction represents set of operations that are executed as a single synchronous unit.
151. What does heap in apex mean?
Ans - Every apex transaction has its heap. Heap is nothing but the garbage collected
at the end of every apex transaction.
152. How many callouts to external service can be made in a single apex transaction?
Ans - A total of 10 callouts are allowed in a single apex transaction
153.What is the maximum allowed time limit while making a callout to external service in apex?
Ans - maximum of 120 second time limit is enforced while making callout to external service
154. How can you expose an apex class as a REST web service in salesforce?
Ans - An apex class can be exposed as REST web service by using keyword '@RestResource'
155. What are custom controllers?
Ans - Custom controller is an apex class that implements all of the logic for a vf page without
leveraging standard controller
156. Can a custom controller class accept arguments?
Ans - No. A custom controller cannot accept any arguments and must use a no argument constructor for outer class.
157. What different type of method can be defined for VF controllers?
Ans - getter methods, setter methods and action methods
158. What are getter methods, setter methods?
Ans - Getter methods retrieve data from controller while setter methods pass data from page to
controller.
159.What is Organisation Wide Default in salesforce?
Ans - Organization wide default is used to set default access level for various standard objects
and all custom objects. Default access can be set as Public read only, Public read write,
Public read write and transfer for different objects.
For example if the record access level is set to private then the records will be
accessible only to owners, users above in role hierarchy and if it shared using manual sharing.
160.Can you set default access in Organization wide default for detail objects (detail object in case of master detail relationship)?
Ans - No, Detail object will always have default access as 'Controlled by Parent' and it cannot be changed.
161. Can you create sharing rules for detail objects?
Ans - No, this cannot be done.
162. Can standard object appear as detail object?
Ans - No, you cannot have standard object as detail object in case of master detail relationship.
163. What are the differences between list and set?
Ans- 1. Set stores only unique elements while list can store duplicates elements
2. elements stored in list are ordered while those stored in set are unordered.
164. What various default accesses are available in OWD?
Ans - Private, Public Read only, Public read write, Public read write transfer, controlled by parent, Public full access
OWD is the default access level on records for any object in sales force.
For custom objects we can see below access levels -
By default after creating custom object OWD access level is Public Read/Write.
Private: only owner and above hierarchy users can have Read/Write access and below hierarchy users don't have any access.
Public Read only: only owner and above hierarchy users can have Read/Write access and below hierarchy users can have only Read Only.
Public Read/Write: Irrespective of role hierarchy every one can have Read/Write permissions on the records.
165. What are the different types of reports in salesforce?
Ans - tabular,summary,matrix and joined
166. Can a user not have a role?
Ans - Yes, this is possible, Role is not mandatory for user.
167. Can a user not have a profile?
Ans - No, a user should always have a profile. Profile is mandatory unlike role.
168. How many custom fields can be created on a object?
Ans - Initial limit is of 500 fields and if needed this can be extended to 800 by raising a case with salesforce.
169- How to minimize heap size?
Ans- Don't use class level variables to store a large amounts of data.
Utilize SOQL For Loops to iterate and process data from large queries.
Construct methods and loops that allow variables to go out of scope as soon as they are no longer needed.
Reduce heap size during runtime by removing items from the collection as you iterate over it.
Use the 'Transient' keyword with variables. It is used to declare instance variables that cannot be saved, and shouldn’t be transmitted as part of the view state for a Visualforce page.
170- What is session Id?
A session ID is a unique number that a Web site's server assigns a specific user for the duration of that user's visit (session).
The session ID can be stored as a cookie, form field, or URL (Uniform Resource Locator)
1)Briefly explain about yourself?
2)What is salesforce architecture?
3)What all the services provided in cloud computing?
4)what all the services that salesforce supports?
5)what is the difference between profiles and roles?
6)what are web services? why we need to go for them? What is WSDL? What is SOAP?
7) Here you attended capgemini written test. If you got selected here you will be sent to technical round..if you got selected in technical round then you will be sent to HP for client interview, because HP is client to capgemini. If you got selected finally.Then you will be put into work. This is the scenario. which process do you apply here either "WORKFLOWS" or "APPROVALS".(I said approvals,i don't know whether it's correct or not).
8)How can you say that it's "APPROVAL"? (i said first we need to be approved in first round then only we will be sent to the next).
9) How you will make a class available to others for extension? (Inheritance concept)
10) In the process of creating a new record, how you will check, whether user has entered email or not in the email field of Account object?
11)How you will write a java script function that display an alert on the screen?
12)What is the value of "renderas" attribute to display o/p in the form of Excel Sheet?
13)How you will get the java script function into Visual-force page?
14)Can we create a dashboard using Visual-force page? and what all the components we use here?
15)What are web tabs?
16)How you will add an attachment from VF page? tell me the component names to achieve this functionality?
17)Security(OWD, Sharing Rules,Manual Sharing).
18)Rate yourself in salesforce?
19)what is your current package?
20)How much you are expecting?
21)You will be given pen and paper, they will ask you to write some simple code.
Accenture Interview Questions
1) What is Dynamic Approval process?
Ans: Dynamic approval routing allows you to specify the approvers for each record using User lookup fields on the record requiring approval. The fields are populated using Apex, using data from a special custom object (the "approval matrix") that contains all the information needed to route the record. The approval process then uses the values in the lookup field, rather than the limited pool of users available in the so-called static process. This provides more flexibility: you could route to different people based on region or some other criteria related to the record, rather than having to write multiple static approval processes in order to perform the same functionality.
2) Flow of execution in validations, triggers & workflows?
Ans: all before triggers, Validations, Workflows, All after triggers.
3) Assignment process & validations.
4) Difference between Trigger.new & Trigger.old?
5) Trigger events? & context variables?
6) Batch Apex?
Ans: Process large no. of records
7) Will one workflow effects another workflow?
Ans: Yes, update field, Re evaluate checkbox true
8) Syntax for upsert & undelete trigger & Purpose undelete?
9) Case management?
Ans : Assignment Rule, Auto Response Rule, Escalation Rule
10) If we want to upload data through DataLoader, what the changes to be done?
Deloitte F2F Interview Question
1. We have 3 objects Account, Contact, Opportunity. In a VF page, we need to display the names of contact & Opportunity which are related to Account.
2. One object (s1) & 3 tasks (t1, t2, t3) are there. Each task performing discount related stuff. Write a trigger that should calculate the sum of 3 tasks. And if any task is modified than trigger should fire automatically & perform the same.
Ans: List
3. How can you convert a lead?
4. What is your Role in your project?
5. Explain 2 VF pages developed by you?
6. How will you deploy? Have you ever involved in deployment?
7. How will you test your code through Sandbox?
8. What is the custom settings ?
9. Difference between SOSL and SOQL in Salesforce ?
10. Custom settings?
11. What is Sales cloud & Service cloud?
12. can a Checkbox as controlling field?
13. Sharing Rules?
14. SOQL & SOSL? Diff between SOQL & SOSL?
15. Difference b/w External ID & Unique ID?
16. What is System.RunAs ()?
17. Explain Test.setPage ()?
18. Why Governor Limits are introduced in Salesforce.com?
TCS F2F interview
1. About project?
2. What are standard objects used in your project?
3. Call outs?
4. Governor Limits?
5. Relationships
6. Different types of field types?
7. Data Migration?
8. Roll-up summary?
9. What is the difference between sales cloud & service cloud?
FIS, Salesforce, KPIT, AON, Xerox Interview Questions
Name three Governor Limits. -- Sosl 20, Soql 100-200, DML 150, Callout 100, time 120 sec, cpu time 10000milisec, 60000msec,future method 50
When do you use a before vs. after trigger?
What’s the maximum batch size in a single trigger execution? 200
What are the differences between 15 and 18 digit record IDs?
Provide an example of when a Custom Setting would be used during development.
When should you build solutions declaratively instead of with code?
Give an example of a standard object that’s also junction object.
Describe a use case when you’d control permissions through each of the following:
– Profiles
– Roles
– Permission Sets
– Sharing Rules
When should an org consider using Record Types?
What are some use cases for using the Schema class? PIcklist values, All objects
A trigger is running multiple times during a single save event in an org. How can this be prevented? Boolean static variable
Why is it necessary for most sales teams to use both Leads and Contacts? So to access any of the personal contact information that was captured on lead records, sales team use the contact record
What is the System.assert method and when is it commonly used? To check expecting value and current value in test class
What are the differences between SOQL and SOSL?
Order the following events after a record is saved:
– Validation rules are run
– Workflows are executed
– “Before” triggers are executed
– “After” triggers are executed
What is Trigger.old and when do you normally use it? To change the value before save
When should you use a lookup instead of a master-detail relationship? If Relationship is not required
What are the advantages of using Batch Apex instead of a trigger? Toprocess large no of records
What are the pros and cons when using a Workflow Rule Field Update vs. a Formula Field?
What are the differences between a Map and a List? Key value pair, order collection of objects
What are the advantages of using Batch Apex instead of a trigger?
Describe a use case for Static Resources. use image and stylesheet in vf page
Provide an example of when a Matrix report would be used. How about a Joined report?
A group of users must be prevented from updating a custom field. What’s the most secure method of preventing this? Sharing Rule
When would you use the @future annotation?
List three different tools that can be used when deploying code. Change set, Eclipse, ANT(Another Neat tool)
When should an Extension be used instead of a Custom Controller? use standard functionaliy and extends new actions
What are the advantages of using External Id fields? Use for Upsert using data loader
What are the uses of the
What are the differences between static and non-static variables in Apex?
What are some best practices when writing test classes? Cover all conditions, use system. asset method
What does the View State represent in a Visualforce page?
What are three new features in the most recent Salesforce release?
Ans: Spring 17 1)You can now create Apex classes that extend System.Exception in the Developer Console. Previously, creating classes whose names contained Exception resulted in an error. This change applies to both Lightning Experience and Salesforce Classic.
2)You can now view all your code coverage results in the Developer Console, even when you have more than 2,000 Apex classes and triggers. Previously, the Developer Console displayed only up to 2,000 rows of code coverage results. This change applies to both Lightning Experience and Salesforce Classic.
3)Only One Test Setup Method per Class is Allowed(previous multiple allowed)
DynamicPicklist Class
The new VisualEditor.DynamicPicklist class is used to display the values of a picklist in a Lightning component on a Lightning page.
Describe the benefits of the “One Trigger per Object” design pattern.
Write a SOQL query that counts the number of active Contacts for each Account in a set.
Declaratively create logic in your org that prevents two Opportunities from being created on a single Account in a single day.
Declaratively create logic in your org that prevents closed Opportunities from being updated by a non System Administrator profile.
American Express F2F Interview Questions
1) Trigger should perform based on user requirement?
It should Trigger when user want to trigger & shouldn’t when trigger don’t want?
2) What are default methods for Batch Apex?
Ans: start(), execute() and finish()
3) Analytical snapshot?
4) Types of Triggers?
5) Other than Data Loader any other way to import Bulk Data?
6) Explain any scenario occurred you to work beyond Governor Limits?7) How u will do Mass Insert through trigger?
8) If I want to Insert, Update any record into ‘Account’. What trigger I have to use?
1. When Workflow limit has over in your Salesforce organization, what are all the alternatives for workflows?
Triggers
Schedulable class
2. Is it possible to write test classes for your triggers?
Yes.
3. If you want to write a workflow for a record in which age should be greater than 18 and it should be a new record. The workflow should not fire for old records. How will you achieve this?
It can be achieved throught IsNew() and age>18 condition in Workflow.
4. If an user is saying that he is unable to login into Salesforce, how will you troubleshoot his login issue?
Login history.
5. Where Roll-up summary field will be there and when it can be used?
Roll-up summary field is applicable only in Master-Detail relationship and it will be present in parent object.
6. Have you used Data loader? If yes, how many records have you migrated to the maximum?
7. What is the difference between Queue and Public Group?
8. If an user is not able to view Reports and Dashboards, how will you provide access to him to Reports and Dashboards?
Create and Customize Reports and Manage public Reports permissions in Profile.
Will update more scenario based questions soon!!!
20) Explain what is Audit trail?
Audit trail function is helpful in knowing the information or track all the recent setup changes that the administration does to the organization. It can store last 6 months data.
Comments
Post a Comment