Pages

Monday, December 12, 2016

Salesforce Interview Questions

1. Name three governor limits?
  • Total number of records retrieved by SOQL queries is 50000.
  • Total number of records retrieved by Database.getQueryLocator is 10000.
  • Total number of SOSL queries issued is 20.
  • Total number of DML statements issued is 150.
  • Total number of callouts in a transaction is 100
  • Total heap size 6 MB (Synchronous Limit), 12 MB (Asynchronous Limit).
2. When do you use before and after trigger?
Before Trigger:
  • Custom validation checks in the same object.
  • Update same record/object.
  • Setting default values
After Trigger:
  • If we need to use Record Id's
  • Inserting or updating the related records.
  • To send notification email post commit.
3. Whats the maximum batch size in a single trigger execution?
      By default size is 200.

4. Whats the differences between 15 and 18 digit record Id's?
      Internally salesforce uses a case-sensitive 15 digit Id's for all records because everything is in control of salesforce but when doing an integration with external applications like access or excel it does not recognize the 15 digit id. The reason is 0014100000ciw1q is different from 0014100000CIW1Q.
      You can get an 18 digit Id of a record by using a formula text field CASESAFEID(id). This is one way to get it.

5. Provide an example of when a custom setting would be used during development.
      Custom settings are hidden gem, they are variables that we use in our code but set and modify outside of our code.

Here's the example.,
Let us write a trigger that sets "Customer Service Rep" field on an Account every time there's a high value opportunity associated with it. Two things are now certain: (1) The CSR on duty changes every week and (2) the threshold for a "high value" opportunity changes often since the company is expanding.

A perfect use case to use Custom Settings is to set the CSR on duty and the "high value" opportunity threshold!

Benefits of using Custom Settings:

  • Change the variable through salesforce.com without deploying the code.
  • Any non-coder admin can now modify your variable and change how your code works!  

6. When should you build solutions declaratively instead of with code?
     As a salesforce best practice, if something can be done using configuration (Declarative) then its preferred over coding. The declarative framework is optimized for the platform and is always preferred.

7. What is a user?
     A user is anyone who logs in to salesforce. Users are employees at your company, such as sales reps, managers and IT specialists, who needs access to the company's records.
   
Still more to come.....


No comments:

Post a Comment