Documente Academic
Documente Profesional
Documente Cultură
1. Batch class and scenario where you used it
ANS>> As salesforce is a multitenant cloud application it has some governor limit. To come over
it we need to use batch classes because a batch class allows us to define a single job that can be
broken up into manageable chunks that will be processed separately.
2. What is database.stateful?
ANS>> Its an interface used to maintain state across transaction. Database.Stateful
using , only
instance member variables retain their values between transaction. suppose you want to update some
records in execute method and then send details of these updated records in finish method then you can
use it.
3. Scheduler Can you schedule a batch , what is the minimum frequency at which you can schedule it
ANS>> We can schedule it for every 10 min by using crontrigger String sch = ’0 10,20,30,40,50 * *
11 ? 2009′;
(http://www.chiragmehta.info/chirag/2009/11/12/salesforcescheduleapextorunatanytimeinterv
al/)
4. Governor limits encountered
ANS>> Check by using limit class
5. Your Roles and responsibilities
6. Have you used asynchronous calls, where and why? Can you call future from Trigger?
ANS>> We can call future from trigger.
7. I want to display a picklist on vf page, which should list all the objects present in the org.On selecting an
object in the picklist, display all the fields present in the object. How will you achieve it
ANS>> schema.describesObjectField to get fields, describeGlobal() to get all objects
8. How many describe calls in a transaction?
ANS>>100 allowed in 1 transaction.
9. How many batch can you write.
ANS>>
■ Up to 5 batch jobs can be queued or active.
■ In a running test, you can submit a maximum of 5 batch jobs.
■ The maximum number of batch Apex method executions per a 24hour period is 250,000 or the
number of user licenses in your organization multiplied by 200, whichever is greater. Method
executions include executions of the start xecute
,e finish
, and methods. This is an
organizationwide limit and is shared with all other asynchronous Apex: scheduled Apex,
future methods, and queueable Apex. The licenses that count toward this limit are full
Salesforce user licenses or Force.com App Subscription user licenses. Chatter Free, Chatter
customer users, Customer Portal User, and partner portal User licenses aren’t included.
■ start
The batch Apex method can have up to 15 query cursors open at a time per user. The
batch Apex execute finish
and methods each have a different limit of 5 open query
cursors per user.
■ A maximum of 50 million records can be returned in the Database.QueryLocator object.
If more than 50 million records are returned, the batch job is immediately terminated and
marked as Failed.
■ start
If the method of the batch class returns a QueryLocator, the optional scope parameter
Database.executeBatch
of can have a maximum value of 2,000. If set to a higher value,
Salesforce chunks the records returned by the QueryLocator into smaller batches of up to
start
2,000 records. If the method of the batch class returns an iterable, the scope parameter
value has no upper limit; however, if you use a very high number, you may run into other
limits.
■ Database.executeBatch
If no size is specified with the optional scope parameter of ,
start
Salesforce chunks the records returned by the method into batches of 200, and then
execute
passes each batch to the method. Apex governor limits are reset for each execution
execute
of .
■ start
The execute
, finish
, and methods can implement up to 10 callouts each.
■ Only one batch Apex job's start method can run at a time in an organization. Batch jobs that
haven’t started yet remain in the queue until they're started. Note that this limit doesn’t cause
execute
any batch job to fail and methods of batch Apex jobs still run in parallel if more than
one job is running.
10. What is action support, action function, Action Status
ANS>>
Action Support:
ActionSupport ActionFunction
1) Directly call action method Call action method from
without javascript javascript with AJAX
It can be used to call action It can be used to call action
2) method on single event method on different event
It can not be called from It defines a new JavaScript
3) javascript function.It only invoke function which can then be
controller action methods from called from within a block of
other Visualforce components JavaScript code.
11. If you want to display records which the user has access to, how will you achieve it?
ANS>> By Using with sharing in class declaration.
12. If in a controller you have a condition that run this only if the logged in users profile is 'Sales Rep', How
will you test this.
ANS>> UserInfo. getProfileId();
13. Mass Emails
ANS>>
Mass Emailing
Pros
1. Is generally faster for the user (you go through a wizard once instead of once per contact.)
Cons
1. Cannot customize the email template on a percontact basis
2. Might not be able to create a filter to select the recipients
3. Visualforce email templates
cannot be used
Individual Emailing
Pros
1. Can customize the email template before sending if you select a text template
2. Does not require Extended Mail Merge to be activated
3. Does not require a filter to select recipient
Cons
1. Time consuming for a large number of emails
Raman
1. What are return types of SOSL and SOQL?
ANS>>
SOQL(Salesforce object query language): Returns list of sObjects, a single sObject, or an Integer for
count method queries.
SOSL(Salesforce Object Search Language): Returns List<List<sObject>>
2. What is SOAP and REST?
ANS>> These are the type of API to expose your data and allow other application to invoke it.
SOAP API
1)Supports data in the form of XML only
2)Requires WSDL for the integration
3)Use SOAP API in any language that supports Web services.
REST API
1)Supports both XML and JSON format
2)Preferred for mobile and web apps since JSON being Lighter the app runs smoother and faster
3. What are getters and setters?
ANS>> Those are custom controller methods
Getter Method returns a value from controller and every value calculated by controller and
displayed on a page must have a corresponding getter
Setter Methods pass user defined values from page to controller
For any action method getter and setter executed
4. Explain Sales Process. What all objects comes under sales process?
5. What are governor limits?
ANS>> As salesforce is a multitenant cloud application it has some governor limit.
6. How many maximum records are returned in a list from SOQL? If we require more records then what to
do?
ANS>> 50,000
7. Difference between trigger.new and trigger.old.
ANS>> Trigger.New: Returns the list of new version of sObjets records(available in insert and
update)
Trigger.Old: Returns the list of old version of sObjets records(available in update and delete)
8. what are trigger context variables.
ANS>>isExecuting,new,old,newMap,oldMap,isInsert,isUpdate,isDelete,isUndelete,isBefore,isAfter,
size
9. Difference between Database.insert and insert DML operations.
ANS>> The difference is that using database class methods we can specify whether or not to
allow partial record processing if errors encountered.
If extra parameter is false then allow partial else if it is true then if 1 record fails all records will
fails
Database classes methods returns saveresults.
10. What is scheduler class? How it is called? What are parameters of method from where we call it?
ANS>> To invoke apex at specific time we use scheduler
We can call it f by using cron trigger or through UI
We need to implement interface schedulable to use this class
it has only one method execute(SchedulableContext SC) {
using SchedulableContext we will get the Id of current apex job
11. What is batch class? What are its methods?
12. When it is required to write a batch class?
ANS>> As salesforce is a multitenant cloud application it has some governor limit. To come over
it we need to use batch classes because a batch class allows us to define a single job that can be
broken up into manageable chunks that will be processed separately.
it has to implement an interface Database.Batchable
it has 3 methods
start method
global (Database.QueryLocator | Iterable<sObject>) start(Database.BatchableContext bc) {}
The start method is called at the beginning of a batch Apex job. Use the start method to collect the
records o r objects to be passed to the interface method execute. This method returns either a
Database.QueryLocator object or an iterable that contains the records or objects being passed
into the job.
Use the Database.QueryLocator object when you are using a simple query (SELECT) to generate
the scope of objects used in the batch job. If you use a querylocator object, the governor limit for
the total number of records retrieved by SOQL queries is bypassed. For example, a batch Apex
job for the Account object can return a QueryLocator for all account records (up to 50 million
records) in an organization. Another example is a sharing recalculation for the Contact object that
returns a QueryLocator for all account records in an organization.
Use the iterable when you need to create a complex scope for the batch job. You can also use the
iterable to create your own custom process for iterating through the list.
execute method:
global void execute(Database.BatchableContext BC, list<P>){}
The execute method is called for each batch of records passed to the method. Use this method to
do all required processing for each chunk of data.
This method takes the following:
● A reference to the Database.BatchableContext object.
● A list of sObjects, such as List<sObject>, or a list of parameterized types. If you are using
a Database.QueryLocator, the returned list should be used.
Batches of records execute in the order they are received from the start method.
finish method
global void finish(Database.BatchableContext BC){}
The finish method is called after all batches are processed. Use this method to send confirmation
emails or execute postprocessing operations.
13. Difference between QueryLocator and Iterable return types.
14.
Provide simple logic for : If a=20, b=40, then swap a and b's value without using 3rd variable.
ANS>> a=a+b; b=ab;a=ab;
a=a*b;b=a/b;a=a/b;
15. What are communities?
16. Intro to Salesforce1.
17. What is extension class? Why do we write it? Difference between Custom and standard extension
classes.
18. When do we write VF page?
19. Challenging requirement ever faced.
20. Batch class In which project have you used it? what was the requirement? How have you fulfilled it?
21. Difference between ActionFunction, ActionSupport, ActionRegion, ActionStatus.
22. How many callouts can be called from within batch class?
23. What are future methods?
24. Difference between static methods and static variables.
25. If an object has 2 parent objects (Master detail relationship), one parent's OWD is private, 2nd 's is
public, what permissions will child have?
26. How many batches can execute at once?
Nikhat Tech M
1. What is map and how you used it
2. Approval Process What is dynamic approval, unanimous and parallel approval
3. Batch Class and its methods
4. Can we schedule a batch and how?
5. In a batch class if you want to count no of opportunities whose amount is greater than 50k and at the end
send the count in an email , what will you use
6. How will you create two picklist in a vf page if the fields are not created in your database. Tell each
components you will use in your vf and class
7. What is action function
8.Types of reports
9. If a user is not getting joined reports options , whats should he do
10. Account has a related list of contacts and a button on that related list to change record type.
can you add a checkbox in that related list, so that if we select few records by checking the checkbox and
click on a button , all the record tpes will be changed?
11. Have you worked on integration?
12. Current project, your roles and responsibilities
13. Scheduler class
14. Sales process
Geeta Eternus
1 st rnd
batch stateful
schedular
select data using like > select contacts via A/c & viceversa
diff between action function & remote action
can we execute DML operation in constructor ? N I want to execute a piece of code on page load how to
apex:page action
governor limit excountered by u & how did u resolve
select data more than 500000
50 m + records how to select ?
list vs set
use of map keySet & value methods
NullPointerException
many scenario based Q's
test.start test & stop test
SOSL
2nd rnd
sales process
why cant I create opp directly why use lead instead ? forecast
analytic snapshot can we use standard object to dump the data ?
joined report scenario & drawbacks
difference between before & after event lots of predict output on basis of above
order of execution
custom settings
integration explain soap & rest
why did u use enterprise wsdl? why not partner.
sites
site.com
community
sso
@isTest class ko nahi likha then code run hoga ?
Knowlege & Solution
What have you worked on service cloud & sales cloud ?
Pawan
1. Difference Sharing and with sharing.
2. Difference between workflow criteria(3 options).
3. @test Annotation
4. Name Trigger context variable and what us isExecuting ?
5. scenario based questions on trigger
how many time after insert trigger get called if 960 record are inserted into salesforce from dataloader with
200 as size.
6. Inserting test record from csv file(static resources) as test data for test class.
7.difference between standard controller and controller and when to use what(use cases)?
8. what is action region and explain the functionality with one use case.
9. what is diff between export all and export button in data loader
10. diff between delete and hard delete
11. how to get deleted records(recycle bin) using the query(soql)
Accenture
2. Lead Assignment
3. How many Extension can be used on a page. If I have 5 extensions and all extensions have method m1.
How can we call the method m1 of 4th extension.
4. I have a .csv with 100 account records with values in description field. I want to updaet those account
records and nullify all the values in description field using data loader . How can we achieve this.
5. Field Sets
6. Can we use trigger.old with before update
7. Context variable
8. What is BulkAPI option in data loader settings.
9 Difference between SOQL and SOSL
10. Return type of SOSL and SOQL
11. Governor limits
12. Difference between Opportunity products and quote line items
13. Inner class and Wrapper class
14. @future annotation
15. System context and User context.
16 Inserting 100 records, 50 records get some validation errors. What will happen to all 100 records.
17. Partial Insert how can be achieved using Database.insert
18. Bulkify code
In After update, you want to update the same records,what will you do?
2. Give an example where you will use @future
3. Explain current project
4. If a detail page is replaced by VF page and user wants the flexibility to add and remove fields, what
approach should we take for this requirement
5. How can you compare date fields in SOQl query
6. How to identify if the user is logged in himself or on behalf of others(using grant login access)
7. How to stop trigger execution using custom setting(Don't know what he was trying to ask)
Warpe
Apex:
Use of Wrapper classes, inner classes
Types of Collections List, Set, Map
Database class methods vs std DMLs
APIs: Enterprise, Partner WSDL, Bulk API
SOAP vs REST, JSON vs XML
Web services in Apex
Email services, static resources
Annotations in apex
Custom settings hierarchical vs list
Governor limits
Async Apex: @future, Batch Apex, Scheduled Apex
SOQL, SOSL
Std/ custom controllers and controller extensions
Test classes, features and limitations
Triggers, order of execution, trigger context vars, Bulkification, recursion problem
VF Pages:
All action tags, actionsupport, actionfunction, actionregion, actionpoller, actionstatus
order of execution
JS remoting vs actionfunction
controllers vs extensions
pageblocktable vs datatable,
Limits on # of records 1000 OOTB or 10000 with @readOnly, best practices
VF templates
List controllers using stdsetcontroller
Salesforce features:
SF packaging managed/ unmanaged.
Migration tools: Data loader, CLI, Eclipse, ANT, Change set
Workflow field update, outbound messaging, email alert, tasks
Approval processes
Roles vs profiles, sharing settings OWD, Sharing rules
Profiles vs permission sets
Login hours vs business hours
Record types, page layouts
Winter’14 features.
Salesforce communities
Chatter how to restrict, topics, groups, files
CRM:
Migrating from legacy apps DL, importing activity history
Sales objs Campaign, leads, accounts, contacts, opps, contracts, forecasts ,products, pricebook, reports
and dashboard
Service objs cases, solutions, knowledge articles,
lead process, sales process
Test classes best practices static resources csv, starttest stoptest, create own data
Visualforce <apex: action*> components, View state considerations and size limits,
# of extensions ??
if method present in each extension left most ext’s method will execute
Ways to implement pagination stdsetcon, custom pagination, which one to use when
action function vs remoteaction when to use and tradeoffs, drawbacks of remote action
for efficiency use action region
Apex:
Batch classes
how to send of failure records consolidated across all batches Database.stateful Interface
trigger order of execution
APIs available, Partner WSDL vs Enterprise WSDL
Account contact and opportunity ?? Roll up summary fields of contact on Account
Best practices apex
My Cognizant
1. What is difference between custom setting and custom object?
2. Different way to move metadata from 1 org to another?
3. What is post Install script?
4. What is Installation Context?
5. How browser applications communicate with Salesforce(Securely)
6. What is sales cloud?
7. What is service cloud?
8. Different ways to raise a case in salesforce?
9. Explain Campaign Management?
10. What is difference between Rendered,Rerender and Rendered as?
11. What's difference between Other languages and apex?
12. If you want to rerender particular block in visualforce using javascript what will you use?
13. For putting Header and Footer in salesforce what will you use?
14. Explain Static variables difference in C# and Apex?
Gunwant Cognizant
1. Can we update parent record if workflow is on child record?
2. What are trigger context variables
3. What are trigger events?
4. WHy we need approval process?
5. What operation we can do in a workflow?
6. If there are 100 records and i upsert them using dataloader, there are 2 reords who has same externalId,
then how many records will be upserted?
7. What is external ID, and for what data type we can create externalId?
8. What we can do in Roll up summery?
9. What is object level relationship?
10. Difference among relationships?
11. What is REST and SOAP?
12. Whe we use REST?
13. Why we use SOAP?
14. Architecture of integration project?
15. If there is a trigger on x object and in that trigger i insert a and b object, but when i insert a, and b some
error occurs in b, what will happen? will 'a' be inserted?
16. Why we need visualforce page, give some examples?
17. How to prevent a trigger to be run twice?
18. What is role and profile?
19. How many triggers we can write on an object?
1. In Apex repeat can we control the number of iteration? How?
Answer Using rows and first attribute in apex repeat.
2. What is use of a documents in salesforce?Why do we need them?
Answer Document is a separate object in salesforce. Which stores org level documents, which
we used in email template,tab icon image.
3. If I have 2 records with same external ID And I tried to upsert using data loader what will happen?
Answer It gives error and records are not inserted.
4. Can I have master detail in 2 std object?
Answer y ou can define masterdetail relationships between custom objects or between a custom object
and a standard object. However, the standard object cannot be on the detail side of a relationship with a
custom object.
5. Can I have junction between 2 std objects?
Answer y
ou can define masterdetail relationships between custom objects or between a custom object
and a standard object. However, the standard object cannot be on the detail side of a relationship with a
custom object.
6. Can I have junction between Lead and account?
Answer y ou cannot create a masterdetail relationship in which the User or Lead objects are the master.
7. Can we make std object as detail?
Same as 4 and 5
8. I am using Apex:actionfunction, on completion of ajax request I want 1 message box, how do I achieve
this?
Answer You can achieve this using oncomlpete attribute on action function as well as you can
achieve this using apex:actionStatus
9. Difference between soap and rest? Dose soap support JSON?
Answer http://salesforce.stackexchange.com/ questions/4051/restapivssoapapiinsalesforce
10. I want to send email alert before 1 day of task due date how could I achieve this?
Answer Using scheduler
11. We set owd on record or object?
Answer Object
12. What are the options on FLS?
Answer Field Level Security Read, Visible
13. what are the option on profile for setting tab?
Answer Default On ,Default Off, Hidden
14. All attributes in apex:actionfunction tag
Answer Name, Value, AssignTo, action,onComplete,rerender ,Status,onbeforedomupdate
1. Using UI we can run apex job once for a day.
2. Using apex we can run apex job on hourly bases.Because on cron expression there is no provision to
provide special characters in second and minute.But if your business requirement is that you want to
schedule a scheduler after every 2 min then has to schedule more than one apex job.In salesforce you can
schedule 100 apex job.