Friday, 19 August 2016
Monday, 25 July 2016
Difference Between Task and Event in Salesforce
Ans :
Event :- An event is a calendar event scheduled for a specific day and time.
Examples of events are:
1) Meetings
2) Scheduled Conference Calls
Anything that involves communication with another person should be set as an event.
Task :-
A task is an activity not scheduled for an exact day and time. You can specify a due date for a task or there may not be a particular time or date that the tasks or activities need to be completed by.
Examples of tasks are:
Examples of tasks are:
- A list of phone calls you need to make.
- An email that needs to be sent.
Salesforce Interview Question and Answers on Apex Class
1. Difference between with sharing and without sharing in salesforce
Ans. By default, all Apex executes under the System user, ignoring all CRUD, field-level, and row-level security (that is always executes using the full permissions of the current user).
with sharing:
Enforcing the User’s Permissions, Sharing rules and field-level security should apply to the current user.
For example:
public with sharing class sharingClass {
// Code here
}
without sharing:
Not enforced the User’s Permissions, Sharing rules and field-level security.
For example:
public without sharing class noSharing {
// Code here
}
2. Access Modifiers
in salesforce
Ans.
– private: This method/variable is accessible within the class it is defined.
– protected: This method/variable is also available to any inner classes or sub-classes. It can only be used by instance methods and member variables.
– public: This method/variable can be used by any Apex in this application namespace.
– global: this method/variable is accessible by all Apex everywhere.
• All methods/variable with the web-service keyword must be global.
– The default access modifier for methods and variables is private.
– protected: This method/variable is also available to any inner classes or sub-classes. It can only be used by instance methods and member variables.
– public: This method/variable can be used by any Apex in this application namespace.
– global: this method/variable is accessible by all Apex everywhere.
• All methods/variable with the web-service keyword must be global.
– The default access modifier for methods and variables is private.
3. Exceptions Statements
in salesforce
Ans.
Throw: signals that an error has occurred and provides an exception object.
• Try: identifies the block of code where the exception can occur.
• Catch: identifies the block of code that can handle a particular exception. There may be multiple catch blocks for each try block.
• Finally: optionally identifies a block of code that is guaranteed to execute after a try block.
• Try: identifies the block of code where the exception can occur.
• Catch: identifies the block of code that can handle a particular exception. There may be multiple catch blocks for each try block.
• Finally: optionally identifies a block of code that is guaranteed to execute after a try block.
Exception Example:
public class OtherException extends BaseException {}
Try{
//Add code here
throw new OtherException(‘Something went wrong here…’);
} Catch (OtherException oex) {
//Caught a custom exception type here
} Catch (Exception ex){
//Caught all other exceptions here
}
public class OtherException extends BaseException {}
Try{
//Add code here
throw new OtherException(‘Something went wrong here…’);
} Catch (OtherException oex) {
//Caught a custom exception type here
} Catch (Exception ex){
//Caught all other exceptions here
}
4. 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"
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"
5. How to get current logged in users id in apex ?
Ans. Userinfo.getuserid()
6. How to fire dynamic query in SOQL?
Ans. Database.query('select name from account');
7. 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];
8. How can you access custom label in apex ?
Ans. System.Label.LabelNamehere
9. What is search layout?
Ans . When we click on lookup field the results which is shown is called search layout.
10. What is mini page layout ?
Ans. For lookup fields on record detail page we see a link, whenever we put cursor on that link we see a popup window which displays few fields.
Wednesday, 20 July 2016
Salesforce Interview Questions on REST API and SOAP API
1. What is SOAP and What is REST?
REST API
Representational State Transfer.
It is based on 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 works with WSDL
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 types 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 this is a great job for the Bulk API.
8. How to call the 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 an 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 salesforce is a 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 an 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 a custom time out for each call out?
Ans :
A custom time can be defined for each callout.
the minimum time is 1 millisecond and the maximum is 120,000 milliseconds.
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
Subscribe to:
Posts (Atom)
Tools for Lightning Web Component Development
Below are the tools required for Web Component Development 1. Chrome Browser (Prefered) You can download it from Google 2. Visual Studio Co...
-
1. What is workflow ? Ans: Workflow works based on certain criteria,By using workflow we can automate the business process like Email alerts...
-
Fundamentals of HTML and CSS HTML - Hypertext Markup Language Hypertext refers to how web pages(HTML documents) are linked together. The m...
-
How to display Salesforce Data Storage Limits for the current Org ? For the population of data storage limits in the VF, we need just a ...