Sunday, December 29, 2019

Salesforce Integration - Latest Interview Questions With Answers

1.What is meant by Integration or Web Services?

In simple terms integration is nothing but exchange/transfer of data between two different applications/systems.This basically provides communication between two applications.These two applications could be of using same technology or it could be of different technology.

Examples :
  • The data exchange between 2 different Salesforce Orgs.
  • The data between Salesforce or Java,.Net or SAP(External services).
The exchange of data happens over internet (Web) so this is termed as Web Services.



2.What is meant by API or Service?

API stands for Application Programming Interface.It is protocol through which one application communicate with other. Salesforce can integrate with third party application and communicate data with API.

In simple terms API is nothing but a class which will take some inputs from the users and returns some response basis on the requirement.The classes which has build for integration purpose can be called as the "Services"

3. What are the popular types of Web Services Protocols available in market?

Below are the two popular Web Services protocol for creating any integration
  • SOAP - Simple Object Access Protocol
  • REST - Representational state transfer
  • Bayeux
Each protocol will have it's own constrains to create any web services.

4. What are the different API's available in Salesforce Eco System?

Salesforce supports wide range of API's so that any external system can interact with Salesforce ecosystem very easily basis on requirement.
  • Bulk Data Processing
  • Tool API's
  • For Building Custom API


For more information please refer

5.What is the difference between REST API and APEX REST API?

Similar to Standard object/fields and Custom object/fields in Salesforce,these APIs are also comes under this Standard APIs and Custom APIs.

REST API: 
This api provided by Salesforce with pre-built set of services which will be running on REST protocol to interact with Salesforce ecosystem.This provides powerful and convenient way to interact with Salesforce system.

This is very easy for integration and it best suits for applications which are running on mobile applications and web projects.The detailed document can be found here.

APEX REST API:

If you have an use case where you want to share some of your salesforce org data with external systems/you want to update salesforce data basis on the external system request with REST protocol and your use case is not available in standard REST API provided by salesforce. 

In these scenarios you will create an apex class which can handle all your scenarios and shares/update the necessary data with external systems at the same time running these apex classes on REST protocol.The entire class or methods which has written then exposed with external systems using this APEX REST API.

The detailed document can be found here

6.What are the Authentication mechanisms used by Apex REST API?
  • OAuth 2.0
  • Session Id
7. What is Callout?

When your making an api call to external system from salesforce we will call it as Callout(because the call is going out from salesforce)

8. Is there any difference between contract details,api details or service details?

There is no difference among all these terms are same.These terms are used to describe about the what is the sample request,sample headers,end point,authentication model and sample response details which can be shared/agreed between two parties for integration.

9.How can you say if i have shown two classes which one is Apex Rest API class and other is normal apex class?

If any class is annotated with @RestResource(urlMapping='/sampleurl') will be treated as Apex Rest API class.

@RestResource(urlMapping='/srinivas4sfdc/getCases/*')
global without sharing class API_Get_Cases
{
  //your code
}


10.What is Remote Site Setting and What is the action of it?

Basically in Remote site settings we will add the external system domain address where Salesforce is going to make a callout for some information.

As soon as you added the domain name to the remote site setting it internally informs the Salesforce ecosystems these are my trusted domain names so you can allow call out to these services from Salesforce.

11.What happens if domain is not added while making a callout from Salesforce to External System?

It's mandatory to add the external system domain names in remote site setting while salesforce making any callout to these services.If not added then salesforce treats all these external systems domain names as not trusted domains .So,callout will not triggered from the salesforce.

12.When an external system is making a call to Salesforce in this case should we add the external System domain name in Remote site setting?

No,it's not required .

13.How will Salesforce authenticates every incoming request?

Every third party request coming into Salesforce will be authenticated by OAuth 2.0,using the OAuth 2.0 third party systems will get the access token first from the salesforce authorization server ,then the access token will be passed as part of every request.

So,Salesforce check whether this token is valid or not,expired or not,if everything if fine then only salesforce processes this request otherwise it will throws an error.

14. What is the default time out an api call out?

120 sec - 2 mins

15. Can we make a callout from Trigger Context(In same transaction)?

No,because when your making a callout to external system we don't know whether you will receive the response immediately or it can take some time and some time these external service might be down as well.

So,if your making a callout in trigger context directly you might goes to the dead lock situation because your trigger is waiting for response from external system but external system is not responding quickly.Just keeping the limits in mind Salesforce doesn't support the callout in same transaction from the trigger context.

16. Can we make a callout from Trigger?If how can we make a callout?

In same transaction execution you can't make a callout but salesforce has provided an workaround solution for this ,by splinting the callout functionality from same transaction context(synchronous) to different transaction context(asynchronous).

Trigger always run on the synchronous mechanism and when you call any method with annotation @future(callout=true) the execution context of this method becomes the asynchronous.So,if you want to make a callout from trigger please place your callout logic inside this method so that the callout context moves into asynchronous and trigger don't wait for the callout response and it continues the execution.

17.Can we make a callout from Trigger without using future method?

No,because in same trigger context you can't make a callout. 

18.What are the Concurrent limits in Salesforce?

If multiple requests are running more than the specified time interval then all those request will be treated under Concurrent limits. Salesforce has broadly divided these limits into 2 categories
  • Concurrent API Request limit
  • Concurrent Callout Request/Apex limit
19.Explain about Concurrent API Request limit?

If salesforce receiving any incoming api request from the external systems and all those api requests which are taking more than 20 sec will be counted under these API Request limits.

At any given point of time salesforce allows only 25 requests running more than 20 sec is allowed.If 25 requests are already took 20 sec and meanwhile if you receive 26th request and if this 26th request is also crossing the 20 sec then system will throws an error an terminates this 26th request automatically.

In case if 26th request is finished it's execution within 20 sec then no error will be thrown.

20. Explain about Concurrent Callout Request/Apex limits?

If salesforce is making any callout to external systems synchronously from visual force,if any callout taking more than 5 sec(long running processes) will be counted under this Concurrent Callout Request limit.

At any given point of time salesforce allows only 10 long running callouts .If already 10 callouts are running and all these taking more than 5 sec,in this case if you receive 11 callout request and if this is also taking more than 5 sec then system automatically terminates this stating concurrent limit exceeded.

21. How can we avoid Concurrent Callout Request/Apex limits?

Yes,we can avoid these errors just moving all these synchronous long running request into asynchronous long running request by using the Continuous Integration.

For more details about this please refer my detail post


Please watch this space more interview questions.

Please follow,bookmark,subscribe this site to receive daily updates.

Facebook - https://www.facebook.com/ILoveCodingYou/?ref=bookmarks

LinkedIn - https://www.linkedin.com/groups/10529690

Hope this helps you..Enjoy..!

5 comments:

  1. Nice Information thanks for sharing with us With the evolving online strategies, all the professional SEO services thus help these varieties of businesses to grasp and to stay up with the market trends and also the program rules. It’s very necessary that you just choose an SEO Agency in Wellington of Ocean Digital. For more information regarding company SEO services reach to its website.

    ReplyDelete