Top 30 Salesforce Apex Interview Questions and Answers Pdf

Top 30 Salesforce Apex Interview Questions and Answers Pdf

Salesforce is the world’s best CRM service provider. They have higher than 40% business share in the Cloud CRM space and manages overall CRM scope with a market percentage of 19.7%. They were ranked the world’s #1 CRM for two following-to-back years and if the forecasted growth of Salesforce is anything to go by, the demand for experts with Salesforce training is only continuing to exponentially progress. This is everywhere Salesforce starts the design, and that is the reason to write a post on the popular frequently supplicated Salesforce interview questions.

Top 50 AWS Interview Questions and Answers Pdf

Gratitude to the experience and wisdom accorded by some of our specialists from the industry, SVR Technologies have shortlisted the comprehensive list of the Top 50 Salesforce interview questions which in turn encourage you to breeze through your interview. Probably, this assists you to land a top-notch job in the field of your enthusiasm (Salesforce Developer Training). In case you revisited a Salesforce interview freshly, we request you to post some questions that you have encountered.

Here are best 30 objective type sample Salesforce Interview questions and their answers are presented simply following them. Certain example questions are composed by professionals from SVR technologies who leads for Salesforce Admin Training to give you an idea of a type of questions which may be claimed in an interview. We have acquired to provide accurate answers to all the questions.

1. What is the use of interfaces(in apex classes)? (Top 30 Salesforce Apex Interview Questions and Answers Pdf)

Answer:An interface resembles a class in which none of the strategies have been executed—the technique marks are there, yet the body of every strategy is void. To utilize an interface, another class must actualize it by giving a body to the greater part of the techniques contained in the interface. (Top 30 Salesforce Apex Interview Questions and Answers Pdf)

Interfaces can give a layer of reflection to your code. They isolate the particular execution of a technique from the announcement for that strategy. Thusly you can have distinctive usage of a strategy in view of your particular application.

2. Can you please give some information about Implicit and Explicit Invocation of apex ?

Answer:

  • Triggers: Implicit
  • Javascript remoting: Explicit

3. In Which object all Apex Triggers are stored ?

Answer: ApexTrigger

4. What is abstract class ?

Answer: Abstract classes will be classes that contain at least one dynamic strategies. A conceptual technique is a strategy that is pronounced however contains no usage. Unique classes may not be instantiated, and expect subclasses to give usage to the theoretical techniques.Top 50 Salesforce Apex Interview Questions and Answers Pdf

5. What’s the best way to check if person accounts are enabled via Apex Code ?

Answer:  I’ve found two methods to accomplish this.

  • Method 1:

Endeavor to get to the is Person Account property on an Account and catch any exemption that happens if that property is absent. In the event that a special case is produced then individual records are handicapped. Else, they’re empowered. To abstain from making individual records required for the (Salesforce Certification Training) bundle you allocate the Account protest a subject and utilize subject. Get (‘is Person Account’) as opposed to getting to that property straightforwardly on the Account question.(Top 30 Salesforce Apex Interview Questions and Answers Pdf)
This method takes ~3.5ms and negligible heap space in my testing.

Skip code block

// Test to see if person accounts are enabled.

public Boolean personAccountsEnabled()

// Try to use the isPersonAccount field.

sObject testObject = new Account();

test Object.get( ‘isPersonAccount’ );

// If we got here without an exception, return true.

return true;

catch( Exception ex )

// An exception was generated trying to access the isPersonAccount field

// so person accounts aren’t enabled; return false.

return false;

  • Method 2:

Use the account meta-data to check to see if the isPersonAccount field exists. I think this is a more elegant method but it executes a describe call which counts towards your (sap training) governor limits. It’s also slightly slower and uses a lot more heap space.

This method takes ~7ms and ~100KB of heap space in my testing.

// Check to see if person accounts are enabled.

public Boolean personAccountsEnabled()

// Describe the Account object to get a map of all fields

// then check to see if the map contains the field ‘isPersonAccount’

return Schema.sObject Type.Account.fields.getMap().containsKey( ‘isPersonAccount’ );

6. How to insert value to a parent and child element at the same time ?

Answer: Use triggers.

7. What are setter and getter methods ?

Answer: Mutator strategy. … They are likewise generally known as setter strategies. Frequently a setter is joined by a getter (otherwise called an accessor), which restores the estimation of the private part factor. The mutator technique is regularly utilized as a part of question situated programming, with regards to the rule of exemplification.

8. How to make pick-list as required (thru java script) ?

Answer: We need to make a custom catch and in that custom catch, we need to compose JavaScript code to check whether the picklist esteem is invalid.

9. Can’t Deploy Due to Errors in 3rd Party Packages ?

Answer:

  • It was already conceivable to introduce oversaw bundles and Ignore APEX Test Errors this isn’t the situation any longer.
  • You are likely must uninstall them on the off chance that you need to convey from Sandbox to creation and reinstall them
  • In the event that it’s Milestones PM (the bundle) is you can most likely get an unmanaged variant to work with and settle the bugs.

UPDATE:

  • It would appear that you are utilizing the unmanaged bundle. So I think on the off chance that you would prefer not to uninstall before going to generate you must fix those blunders physically by settling the code.
  • Sadly, SFDC test strategies don’t live in a total vacuum where you can run tests against your organization without knocking other code, notwithstanding when you go to convey. Salesforce Training Free Demo

10. What is the Difference between Ajax and ActionPoller ?

Answer: ActionPolleris a clock that sends an AJAX refresh demand to the server as indicated by a period interim that you determine.(Top 30 Salesforce Apex Interview Questions and Answers Pdf)

11. How do you refer to current page id in apex ?

Answer: If you want to retrieve id in a visauflrorc page then you can retriev it using standard cotnroller.

for ex:

public myControllerExtension(ApexPages.StandardController stdController) {

this.acct = (Account)stdController.getRecord();

12. When a case is generated by an user through web to case, how or where a developer will provide solution case arised ?

Answer: Email notice through the trigger or through email ready Workflow run the show.

13. What is page reference

Answer: A Page Reference is a reference to an instantiation of a page. Among different characteristics, Page References comprise of a URL and an arrangement of inquiry parameter names and qualities.

14. How Can I Tell the Day of the Week of a Date ?

Answer:

Formulas:

There isn’t a worked incapacity to do this for you, yet you can make sense of it by checking the days since a date you know. Here’s the idea: I realize that June 29, 1985, was a Saturday. In case I’m endeavoring to make sense of the day of the seven day stretch of July 9 of that year, I subtract the dates to (Pivotal Training) determine the number of days (10) and then use modular division to figure to remove all the multiples of 7. The remainder is the number of days after Saturday (1 = Sunday, 2 = Monday, etc.) and you can use that number in your logic:

MOD(DATEVALUE( Date_Field__c ) – DATE(1985,7,1),7)

Apex Code

You could do the same thing with time deltas, but you can also use the poorly documentedDateTime.format() function:

// Cast the Date variable into a DateTime

DateTime myDateTime = (DateTime) myDate;

String dayOfWeek = myDateTime.format(‘E’);

// dayOfWeek is Sun, Mon, Tue, etc.

15. I have added an string ‘updated’ to all users in Account object through batch apex, now how to remove that ‘updated’ ?

Answer: Run the below code in developer console

List acc =[SELECT Id, Name FROM Account];

for(Account a : acc)

a.Name = a.Name.removeEnd(‘Updated’);

update a;

(Top 30 Salesforce Apex Interview Questions and Answers Pdf)

16. How do you pass the parameters from on apex class to another to another ?

Answer: You can simply pass the parameters through the URL.

say you are redirecting from one VF page to another

string value = ‘your param value’;

string url;

url = ‘/apex/VF_Page_Name?param1=’ + value;

PageReference pageRef = new PageReference(url);

pageRef.setRedirect(true);

return pageRef;

Then in the controller of the VF page, you just can get the param like this

String param_value = system.CurrentPageReference.GetParameters().get(‘param1’); (Salesforce)

17. What are outbound messages ? what it will contain ?

Answer: In outbound message contains end point URL.

18. What is virtual class ?

Answer: In protest situated programming, a virtual class is a settled inward class whose capacities and part factors can be abrogated and reclassified by subclasses of the external class. Virtual classes are closely resembling virtual capacities. (Top 30 Salesforce Apex Interview Questions and Answers Pdf)

19. Can you tell me what is time based workflow ?

Answer: Time Based work process will be activated at what time we characterize while making the Time-Dependent work process run the show.

20. In Data loader using upsert operation can u do update a record if that record id is already exist in page and if updated that record then can u update 2records with having same id and if not updated 2 records then what error message is given ?

Answer: It isn’t conceivable to refresh records with the same id in a document utilizing upsert task. It will toss “copy ids discovered” blunder.

(Top 30 Salesforce Apex Interview Questions and Answers Pdf)

21. Can you give me situation where we can you workflow rather than trigger and vice versa ?

Answer: If you need to play out any activity after some activity, we can go for Workflow Rule.

On the off chance that you need to play out any activity when some activity, we can go for Trigger. (Salesforce Interview Questions and Answers)

22. Say About Visual force page ?

Answer: Using VF tags we can develop visualforce pages.

23. Lets say I have a requirement whenever a record is created I want to insert a record on some other object ?

Answer: Triggers can be used for this. (Top 30 Salesforce Apex Interview Questions and Answers Pdf)

24. One product cost is 1000. It is stored in invoice so once if change the cost of product to 800 then how can i update it automatically into a invoice ?

Answer: We can achieve this using triggers or through relationship among objects.

25. What is the difference between trigger.new and trigger.newmap ?

Answer

  • Trigger. New can be utilized as a part of when activities.
  • Trigger.newMap can be utilized as a part of after embed and after and before a refresh.Take in Salesforce Training Online From Real Time Experts (Top 30 Salesforce Apex Interview Questions and Answers Pdf)

26. Whenever a record is inserted in contact I want insert a record in opportunity as well, we can’t do it with workflow right how would you do it with trigger ?

Answer: We can get the Account Id from the Contact and we can create an Opportunity under the Account.

27. What is overloading ?

Answer:

  • Over-burdening alludes to the capacity to utilize a solitary identifier to characterize numerous techniques for a class that contrasts in their information and yield parameters. Over-burden techniques are for the most part utilized when they reasonably execute a similar undertaking yet with a somewhat unique arrangement of parameters.
  • Over-burdening is an idea used to stay away from excess code where a similar strategy name is utilized numerous circumstances yet with an alternate arrangement of parameters. The real strategy that gets called amid runtime is settled at assemble time, along these lines maintaining a strategic distance from runtime mistakes. Over-burdening gives code lucidity, takes out many-sided quality, and upgrades runtime execution.

28. Can you tell me what is the difference between apex:actionfunction and apex:actionpoller? Is there any way that we can do the same functionality of apex:actionpoller do ?

Answer:

  • Pinnacle: ActionPoller is utilized to call an Apex technique for the interim of time indicated.
  • Summit: Action Function is utilized to call Apex strategy from JavaScript.
  • Utilizing set Timeout in JavaScript, we can accomplish apex: actionPoller functionalities.

(Top 30 Salesforce Apex Interview Questions and Answers Pdf)

29. What is apex test execution ?

Answer: Executing apex test classes.

30. What is overriding ?

Answer:

  • Abrogating is a protest situated programming highlight that empowers a tyke class to give diverse usage to a strategy that is as of now characterized and additionally actualized in its parent class or one of its parent classes. The overriding technique in the kid class ought to have a similar name, mark, and parameters as the one in its parent class.
  • Superseding empowers dealing with various information writes through a uniform interface. Consequently, a bland technique could be characterized in the parent class, while every tyke class gives its particular execution to this strategy. Salesforce Video Training

(Top 30 Salesforce Apex Interview Questions and Answers Pdf)


 
Boost your career skills
Faculty: 10+ years Experience   ---   Duration: 30 - 35 Hours
​100% Hands on Classes   ---   Real Time Scenarios   ---   Free Recordings
I AM INTERESTED
close-link
Learn DevOps with 30+ Real Time Scenarios - ₹ 9000 ₹5999
Make an Enquiry ! ask your queries.
Send
Send