Thursday, March 10, 2016

salesforce interview questions part3

1. Can we modify records directly in trigger.new ?
Ans: trigger.new is a read only list, but field values can be changed in case of before trigger
2. What does the error "list has no rows for assignment" mean?
Ans: it means the list you are trying to access has no values in it.
3. Why should we not write select query within for loop?
Ans: Writing select query within for loop may hit the governer limit of 100 select queries.
4. What should we do to avoid view state error in visualforce page?
Ans: Clear unused collections, define variable as transient.
5. What is a sandbox org?
Ans: It is the exact copy of your production org.
6. What is sosl?
Ans: select query that can return records of multiple objects as list of lists
7. How many records a select query soql can return?
Ans: as of now the limit is 50000
8. What is the full form of AJAX?
Ans: it stands for assynchronous java and XML
9. Why do we need to write test classes?
Ans: Salesforce does not allow deployment in production if the test coverage is less than 75%
10.How can you show a custom error message in trigger?
Ans: This can be done using addError() method in trigger
11. What is the use of future annotation?
Ans: Future method starts execution when Salesforce has resources available.That is for asynchronous execution.
12. How to identify if a class is a test class?
Ans: test class always begins with @isTest
13. How to convert a blob variable into a string?
Ans Use toString to convert blob into string
14. what are the different methods of batch apex class?
Ans: start method, execute method and finish method
15.What is' with sharing' in apex class code?
Ans: When you use 'with sharing', user's permissions and field-level security are respected. In case of 'without sharing' code runs in system mode.
16. How many records can a sosl return ?
Ans: It can return 2000 records as of now as per governers limit
17. Can you use dml statement in visualforce compoenent controller ?
Ans: To use dml in visualforce component you have to declare allowdml=true in visualforce component otherwise you will get an exception
      "DML is currently not allowed"
18. Can you write sosl in trigger>?
Ans: Earlier this was not allowed but now sosl are allowed in triggers.
19. Which are the different access modifiers in apex?
Ans: 1. Private 2. Public 3. Protected 4.Global are the four access modifiers allowed in apex
20. Can you change the master of a detail record in salesforce ?
Ans. Yes provided you have ticked marked "Allow reparenting" in field setting otherwise the field is read only and master cannot be changed.
21. 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];
22. IS there any limit on the number of items that can be stored in apex collections?
Ans: There is ni such limit but we need to consider heap size limit 6mb (6 MB as of now)
23. How can you monitor future actions of time based workflow?
Ans: setup --> administration set up --> monitoring --> time based workflow
24. What is visaulforce component ?
Ans: It is a piece of code that can be reused. It can be encapsulated in other visualforce pages.
25. Ho can you display the status of an AJAX update request in a visualforce page ?
Ans: To display AJAX request status we can use <apex:actionstatus> component.
26. How can you access custom label in apex:
Ans: Example --> string custLabelstr = System.Label.LabelNamehere
27.How can you get all the keys of a map variable ?
Ans: USe method keyset() for this
     Example = Set<id> idSet = mapname.keyset();
28. How can you compare values of a picklist field in validation rule?
Ans : for comparing picklist value use ispickval
      ISPICKVAL(picklist_field, text_to_compare)
29. What are the different types of sandboxes in salesforce ?
Ans: Developer, Developer Pro, Partial Data and Full are the 4 types of sandboxes in salesforce.
30. With what frequency can you refresh a full copy sandbox?
Ans: full copy sandbox can be refreshed every 29 days from production.
31. How can you make fields required on a visualforce page?
Ans: mark required = true as done in the example below:
     <apex:inputfield value="{!account.Description}" required="true"/>
32. What is minimum coverage for every trigger for deployment?
Ans: every trigger should have a minimum coverage of 1%. Total coverage should be 75%
33. What is minimum coverage for every class for deployment?
Ans: There is no such requirement. A class can have 0% but the total coverage should be >75%
34. How can you implement custom functionality for a standardcontroller visualforce page?
Ans: This can be done by associating a controller class with that standard controller using "Extenssions"
35. How can you get the current record id in a visualforce page ?
Ans use ApexPages.CurrentPage().getparameters().get('id') to get the current record id in visaulforce page.
36. Can a user change his own profile in salesforce ?
Ans: No, a user cannot change change his own profile !!
37. Can a user change his own role?
Ans: Yes this can be done !!
38. Reset security token option is unavailabel in set up. What could be the reason?
Ans: If in the profile setting "login ip ranges" have been set up then the option of "reset security token" is uanvailbale.
39. How can you skip record type selection page(and take up default record type) while creating new record of a aprticular object ?
Ans: just tickmark against the object by navigating to following :
     set up --> my personal information -- > Record type selection --> check against the required object
40. What are the different data types that a standard field record name can have?
Ans: Record name field can have either of the two data types : Auto Number or Text data type
41. Can you edit a apex trigger/apex class in production environment ?
Ans: No apex trigger /class cannot be edited in production.
42. Can you edit a visuaflorce apge in production environment ?
Ans: Yes this can be done.
43.How can you deliver a visualforce page in excel form ?
Ans: use contentType="application/vnd.ms-excel#Contacts.xls" in page component of visualforce page
44. What is trigger.new?
Ans: It is a list of records in current context in a trigger.
45. What does it mean when you get the error "too many soql queries 101 salesforce"
Ans: It means you are hitting the limit of 100 soql queries as per governers limit
46. How can you create a input field for date on a visualforce page ?
Ans: To create a input date field on vf page you will have to bind it with a existing date field on any object.
47. How can you convert a text to upper string ?
Ans: stringname.toUppercase();
48. How can you convert a integer into a string ?
Ans: string.valueof(integerName);
49. What are the different types of email templates that can be created in salesforce?
Ans: Text, HTML (using Letterhead), Custom (without using Letterhead) and Visualforce.
50. How can you display different picklist values for picklist fields in different page layouts?
Ans: This can be done using record types.

Salesforce interview question part2

1. For which criteria in workflow "time dependent workflow action" cannot be created?
    Ans: created, and every time it’s edited
2. What is the advantage of using custom settings?
     Ans : You dont have to query in apex (fire select query) to retrieve the data stored in custom settings.
3. What are the different workflow actions available in workflows?
     Ans: 1. Field update 2. Email alert 3. send Outbound messages 4. Create new task
4. What is whoid and whatid in activities?
    Ans: Whoid is the id of either contact or Lead. Whatid is the id of the related to record in activity record(standard or custom object)
5. 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 "extenssions"
6. Can you have more than one extenssions associated with a single page?
     Ans : Yes we can have more than extenssions.
7. If page is having multiple extenssions and if two extenssions have methods of same name.     Then which method out of these two will be called upon calling from vf page ?
  Ans: The one which is present in the controller defined on the left side will be called.
8. What are governer limits ?
     Ans: Governer limits are the limits imposed by salesforce so as to avoid monopoly by orgs in using salesforce shared resources.
9. how can we implement pagination in visualforce ?
    Ans: use standardset controllers for implementing pagination.
10. What is the difference between force.com and salesforce.com
       Ans: force.com is paas(platform as a service) and salesforce.com is Saas(software as a service)
11. What is a externalid in salesforce
       Ans: It is a field which can be used to store a value that is used as a refernce for that record in other system. For example if you have a record in system 'xyz' where it is referenced by some value then that value can be used as external id in salesforce for that record. External id can be used for upsert operation in data loader
12. What happens upon lead conversion ?
       Ans: When lead is converted a contact, account and optionally an opportunity is created.
13. What are different ways of deployment in salesforce ?
       Ans: Change sets, eclipse and ANT
14. How can you override a list button with a visuaflorce page?
       Ans: Visualforce page should be a list controller that is it should have "recordsetVar" attribute defined in page tag.
15. Is it possible to bypass Grant Access Using Hierarchies in case of standard objects ?
      Ans : No. This is default and cannot be changed.
How can you call a controller method from java script ?
Ans: Use action function component to call controller method from java script.
17. How can you call a visualforce page from a controller method?
Ans: Use pagereference object for calling a visualforce page from controller method
18. How can you sort a select SOQl query ?
Ans: use order by clause in select query for sorting a list of records
19. How much code coverage is needed for deployment?
Ans : Each trigger should have minimum of 1%. Class can have 0%. But, the total code covergae of 75%.
20. Can 'set' store duplicate values in it?
Ans : No. Set only stores unique values. List can have duplicate values in it.
21. Can two users have same profiles?
Ans: Yes
22. How can you refresh a particular section of a  visualforce page?
Ans: This can be done using reRender attribute 
23. How can you create a many to many relationship in salesforce
Ans: This can be done by creating junction object between the two objects.
24. What happens to detail record when a master record is deleted?
Ans: detail record gets deleted.
25. What happens to child record when a parent record is deleted(look up relationship)?
Ans. Child record remains undeleted 
26. How to get current logged in users id in apex ?
Ans: Use Userinfo.getuserid() to get the current logged in user's id in apex.
27. How to convert a csv file  browsed in visualforce page into a string.
Ans: use csvfilecontents.tostring(). method to convert blob to string
28.How many records can a select query return ?
Ans : As of now it can return upto 50000 records.
29. How many records can a sosl query return ?
Ans: as of now it can return upto 2000 records
30. How to fire dynamic query in soql?
Ans: Using database.query
     Example: List<account> accList = Database.query('select name from account');
What is a bucket field in reports?
Ans: This field is used for custom grouping of values in a field. This can be used in summarising the report.
32. What are dynamic dashboards ?
Ans: Dashboards which run for logged in user are dynamic dashboards
33. Can the dynamic dashboards be scheduled?
Ans: No they cannot be scheduled.
34.How can you use custom label; in visualforc page?
Ans: Use this syntex for accessing custom albel in visualforce page - {!$Label.Samplelabel}
35.What are the types of custom settings in salesforce?
Ans: List type and Heirarchy type
36.What are the different types of collections in apex?
Ans: There are three types of collections in apex language
     1. Set
     2. List
     3. Map
37. What are maps in apex?
Ans: Map has keys and values. A key points to a single value. Map can be used to store realationship between two entities. Keys in map are unique. Values can be duplicated.
38. What are the different types of object relations in salesforce ?
Ans: 1. One to many
     2. Many to many
     3. Master detail
39.Can you have roll up summary fields in case of parent child relationship?
Ans: No. These are present only in case of master details relationship.
40. Can you see a lead which is converted in saleforce UI?
Ans: The detail record is not seen. But a page, wherein it shows the links for formed account, contact and opportunity.
41. What is the difference between action function and action support ?
Ans: Action functions can call controller method from java script, action support adds support to other components.
42. What is action poller in visualforce ?
Ans: Action poller sends AJAX request with a specified time interval.
43. What are the different types of reports available in salesforce?
Ans: 1. tabular report
     2. Summary Report
     3. Matrix Report
     4. Joined Report
44. How many active assignments rule can you have in lead/Case?
Ans: You can have only one active assignment rule at a time
45. How do we access static resource in visualforce?
Ans: Use this syntex for accessing static resource {!$Resource.Testresourcename}
46. How to embed a visaulflow in a visualforce page ?
Ans: Use this syntex to embed flow in vf page : <flow:interview />
47. How to enable inline editing in visauflorce page ?
Ans You can enable inline editing in visualforce page by using <apex:inlineEditSupport> component.
48. What is trigger.new in trigger ?
Ans: trigger.new is a list of records that are in the context of trigger or becuase of these records(modification,Creation, deletion) the trigger has been called
49. How do we bulkify the trigger ?
Ans: Bulkfification requires iterating over all the records in trigger context
     for example : for(account ac: trigger.new){
                       // your logic here           
                   }
50.How can we get the old value in trigger ?
Ans: use trigger.old map for getting previous values of fields.

Salesforce interview question part1

(1). What is Apex in Salesforce?
• Apex is a procedural scripting language in discrete and executed by the Force.com platform.
• It runs natively on the Salesforce servers, making it more powerful and faster than non-server code, such as JavaScript/AJAX.
• It uses syntax that looks like Java
• Apex can written in triggers that act like database stored procedures.
• Apex allows developers to attach business logic to the record save process.
• It has built-in support for unit test creation and execution.
Apex provides built-in support for common Force.com platform idioms, including:
• Data manipulation language (DML) calls, such as INSERT, UPDATE, and DELETE, that include built-in DmlException handling
• Inline Salesforce Object Query Language (SOQL) and Salesforce Object Search Language (SOSL)queries that return lists of sObject records
– Looping that allows for bulk processing of multiple records at a time
– Locking syntax that prevents record update conflicts
– Custom public Force.com API calls that can be built from stored Apex methods
– Warnings and errors issued when a user tries to edit or delete a custom object or field that is referenced by Apex
Note: Apex is included in Unlimited Edition, Developer Edition, Enterprise Edition, and Database.com
Apex vs. Java: Commonalities
• Both have classes , inheritance, polymorphism, and other common OOP features.
• Both have the same name variable, expression, and looping syntax.
• Both have the same block and conditional statement syntax.
• Both use the same object, array, and comment notation.
• Both are compiled, strongly-typed, and transactional.
Apex vs. Java: Differences
• Apex runs in a multi-tenant environment and is very controlled in its invocation and governor limits.
• To avoid confusion with case-insensitive SOQL queries, Apex is also case-insensitive.
• Apex is on-demand and is compiled and executed in cloud.
• Apex is not a general purpose programming language, but is instead a proprietary language used for specific business logic functions.
• Apex requires unit testing for deployment into a production environment.

(2). What is Visualforce in Salesforce?
Visualforce is the component-based user interface framework for the Force.com platform. The framework includes a tag-based markup language, similar to HTML. Each Visualforce tag corresponds to a coarse or fine-grained user interface component, such as a section of a page, or a field. Visualforce boasts about 100 built-in components, and a mechanism whereby developers can create their own components.
• Visualforce pages can react differently to different client browsers such as those on a mobile or touch screen device.
• Everything runs on the server, so no additional client-side callbacks are needed to render a complete view.
• Optional server-side call outs can be made to any Web service.
Visualforce is a Web-based framework that lets you quickly develop sophisticated, custom UIs for Force.com desktop and mobile apps. Using native Visualforce markup and standard Web development technologies such as HTML5, CSS, JavaScript, and jQuery, you can rapidly build rich UIs for any app.
 (3). Apex code Execution Governors and Limits

(4). Apex Data Types
Apex primitive data types include
– String
– Blob (for storing binary data)
– Boolean
– Date, DateTime and Time
– Integer, Long, Decimal, Double
– ID (Force.com database record identifier)
– Example:
• DateTime dt = System.now() + 1;
• Boolean isClosed = true;
• String sCapsFirstName = ‘Andrew’.toUpperCase();
Apex sObject Types
– Sobject (object representing a Force.com standard or custom object)
– Example:
• Account acct = new Account(); //Sobject example
Apex has the following types of collections
– Lists
– Maps
– Sets
– Example:
• List myList = new List();
• myList.add(12); //Add the number 12 to the list
• myList.get(0); //Access to first integer stored in the List
Enums
• Enum (or enumerated list) is an abstract that stores one value of a finite set of specified identifiers.
• To define an Enum, use enum keyword in the variable declaration and then define the list of values.
• By creating this Enum, you have created a new data type called Season that can be used as any other data type.
– Example:
• public enum Season {WINTER, SPRING, SUMMER, FALL}
(4). Variables
Local variables are declared with Java-style syntax.
For example:
Integer i = 0;
String str;
Account a;
Account[] accts;
Set s;
Map<ID, Account> m;
(5). Static Methods and Variables
• Class methods and variables can be declared as static. Without this keyword, the default is to createinstance methods and variables.
• Static methods are accessed through the class itself, not through an object of the class:
Example:
public class blogReaders {
public static boolean firstScript = false;
}
• Static methods are generally utility methods that do not depend on an instance. System methods are static.
• Use static variables to store data that is shared with in the class.
– All instances of the same class share a single copy of static variables.
– This can be a technique used for setting flags to prevent recursive
(6). What is the use of static variable?
When you declare a method or variable as static, it’s initialized only once when a class is loaded. Static variables aren’t transmitted as part of the view state for a Visualforce page.
Static variables are only static within the scope of the request. They are not static across the server, or across the entire organization.
(7). Final variables
• The final keyword can only used with variables.
– Classes and methods are final by default.
• Final variables can only be assigned a value once.
– This can either be at assigned a value once.
• When defining constants, both static and final keywords should be used.
– Example: public static final Integer =47;
(8). Difference between with sharing and without sharing in salesforce
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
}
Enforcing the current user’s sharing rules can impact: (with sharing)
SOQL and SOSL queries – A query may return fewer rows than it would operating in system context.
DML operations – An operation may fail because the current user doesn’t have the correct permissions. For example, if the user specifies a foreign key value that exists in the organization, but which the current user does not have access to.
 (9). Class Constructors
• A constructor is a special method used to create (or instantiate) an object out of a class definition.
– Constructors never have explicit return types.
– Constructors have the same name as the class.
• Classes have default, no-argument, public constructor if no explicit constructors is defined.
– If you create a constructor that takes arguments and still want a no argument constructor, you must explicitly define one.
• Constructors can be overloaded, meaning you can have multiple constructors with different parameters, unique argument lists, or signatures.
• Constructors are called before all other methods in the class.
For Example:
public class TestObject2 {
private static final Integer DEFAULT_SIZE = 10;
Integer size;
//Constructor with no arguments
public TestObject2() {
this(DEFAULT_SIZE); // Using this(…) calls the one argument constructor
}
// Constructor with one argument
public TestObject2(Integer ObjectSize) {
size = ObjectSize;
}
}
New objects of this type can be instantiated with the following code:
TestObject2 myObject1 = new TestObject2(42);
TestObject2 myObject2 = new TestObject2();
(10). Class Access Modifiers
• Classes have different access levels depending on the keywords used in the class definition.
– global: this class is accessible by all Apex everywhere.
• All methods/variables with the webService keyword must be global.
• All methods/variables dealing with email services must be global.
• All methods/variables/inner classes that are global must be within an global class to be accessible.
– public: this class is visible across you application or name space.
– private: this class is an inner class and is only accessible to the outer class, or is a test class.
• Top-Level (or outer) classes must have one of these keywords.
– There is no default access level for top-level classes.
– The default access level for inner classes is private.
– protected: this means that the method or variable is visible to any inner classes in the defining Apex class. You can only use this access modifier for instance methods and member variables.
To use the private, protected, public, or global access modifiers, use the following syntax:
[(none)|private|protected|public|global] declaration

(11). Variable and Method Access Modifiers

• Link classes, methods and variables have different levels depending on the keywords used in the declaration.
 private: This method/variable is accessible within the class it is defined.
 protected: This method/variable is also available to any inner classes or subclasses. 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 webService keyword must be global.
– The default access modifier for methods and variables is private.

(12). Casting

Apex enables casting: A data type of one class can be assigned to a data type of another class, but only if one class is a child of other class.
• Casting converts an object from one data type to another.
• Casting between the generic sObject type and the specific
sObject type is also allowed.
For Example:
sObject s = new Account();
Account a = (Account)s;
Contact c = (Contact)s //this generates a run time error.

(13). Exceptions Statements

Similar to Java, Apex uses exception to note errors and other events that disrupt script execution with the following keywords:
 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.
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
}

(13). Exception Methods

All exceptions support built-in methods for returning the error message and exception type, below is the some of the Exception Methods,
AsyncException
CalloutException
DmlException
EmailException
JSONException
ListException
MathException
NoAccessException
NoDataFoundException
NullPointerException
QueryException
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_classes_exception_methods.htm

(14). Loops

• Apex supports the following five types of procedural loops:
 do {statement} while (Boolean_condition);
 while (Boolean_condition) statement;
 for (initialization; Boolean_exit_condition; increment) statement;
 for (variable : array_or_set) statement;
 for (variable : [inline_soql_query]) statement;
• All loops allow for loop control structures:
 break; exits the entire loop
 continue; skips to the next iteration of the loop
What is a Business Process?
• Allows you to track separate sales, support, and lead lifecycles
across different divisions, groups, or markets
Available Business Processes:
– Sales Processes – Create different sales processes that include some or all of the picklist values available for the Opportunity Stage field
– Support Processes – Create different support processes that include some or all of the picklist values available for the Case Status field
– Lead Processes – Create different lead processes that include some or all of the picklist values available for the Lead Status field
– Solution Processes – Create different solution processes that include some or all of the picklist values available for the Solution Status field
(22). What are the Objects available in the Salesforce Business Process and Give some Business Process Example?
Lead
Opportunity
Case
Solution
–You must create the business process before creating record types for each of above objects.
– You can then associate each business process with one or more record types and make it available to users based on their profile.
– In order to implement more than one business process, multiple record types must also be implemented.
Business Process Examples
Lead Processes:
– Cold Call
– 3rd Party telesales companies
– Leads generated via campaigns
– Leads generated via a registration form
Opportunities Sales Processes:
– Miller Heiman/ Solution Selling Methodology
– Inside Sales vs. Outside Sales
– New business vs. Existing Business (Up selling)
Case Processes:
– Customer Inquiries
– Internal Requests
– Billing inquiries
Solutions Processes:
– Internal vs. Public Knowledge Base
(23). What about Web-to-Lead and Web-to-Case?
–A lead or case record created through Web-to-Lead or Web-to-Case will set the record type to that of  the default lead owner or automated case user (optional)
(24). On which tabs can I create multiple record types?
–Multiple record types may be created for every tab, with the exception of the Home, Forecasts, Documents, and Reports tabs.
(25). What happens if I need to add a picklist value?
–You will be prompted to select which record types should include the new value
(26). What is Field-Level Security?
– Defines users’ access to view and edit specific fields in the application
(27). Why use Field-Level Security?
– Use Field-Level Security (rather than creating multiple page layouts) to enforce data security
– Users view data relevant to their job function Troubleshooting Tools
– Field accessibility views
– Setup | Administration Setup | Security Controls | Field Accessibility
Notes:
• Field Level Security is not available in PE
• Field-level security cannot be used to make a field required. This is done from the Page Layout
• Field access settings can be defined using both field-level security and page layouts. However, the most restrictive field access setting of the two will always apply. For example, if a field is required on the page layout, but read-only in the field-level security settings, the field will be read-only.
• Hiding a field from a user using FLS also hides that field from list views, search results, and reports.
(28).  What are Login Hours and Login IP Ranges?
– Sets the hours when users with a particular profile can use the system
– Sets the IP addresses from which users with a particular profile can log in
Notes:
• You can customize profiles to restrict users’ ability to log in to Salesforce.
• You can set the hours when users can log in and the IP addresses from which they can log in.
If a user logs in before the restricted hours, the system will end the user’s session when the restricted hours begin.
Two Options for Restricting Access via IP Ranges
Option 1: Add Trusted IP Ranges for your entire org
Option 2: Add Trusted IP Ranges on a Profile by Profile basis

(29).  What is a User Record?
– Key information about a user
– Each has its own unique username
– User logs in with username and password
– Users can be active or inactive; an active user uses a license
– Users are associated with a Profile
– Users are usually associated with a Role
(30). What is a Record Owner?
– The user (or queue for Cases and Leads) who controls or has rights to that particular data record
– An Owner has the following special privileges:
• View and edit capabilities
• Transfer capability – change ownership
• Deletion capabilities
– Important assumption: Object permissions enabled
– The Account Owner, Opportunity Owners and Case Owners may or may not be the same user.
(31) What are Organization Wide Defaults?
– Defines the baseline level of access to data records for all users in the Organization (not including records owned by the user or inherited via role hierarchy)
– Used to restrict access to data
Access levels:
-Private
-Public Read/Write
-Public Read/Write/Transfer
-Controlled by Parent
-Public Read Only


(32). What is a Role and Role Hierarchy?
Role:
– Controls the level of visibility that users have to an organization’s data
– A user may be associated to one role
Role Hierarchy:
– Controls data visibility
– Controls record roll up – forecasting and reporting
– Users inherit the special privileges of data owned by or shared with users below them in the hierarchy
– Not necessarily the company’s organization chart
Notes:
• If using Customizable Forecasting, there is a separate forecast role hierarchy.
• EE can create Account, Contact, Opportunity and Case Sharing Rules. PE can ONLY create Account and Contact Sharing Rules.
• Assuming no sharing rules have been created, users in the same role cannot access one another’s records.
Example: Org Wide Default settings for opportunities are private. Creating a role and adding two users to that role does not allow those users access to one another’s opportunities.
• “Grant Access Using Hierarchies” allows you to disable the default sharing access granted by your role and territory hierarchies. This option can be changed for custom objects that do not have their organization-wide default sharing setting set to Controlled by Parent.
(33). What is Access at the Role Level?
– Defined when creating a role
– Level of access to Opportunities associated to Accounts owned by the role
– Level of access to Contacts associated to Accounts owned by the Role
– Level of access to Cases associated to Accounts owned by the role
– Level of access options depend on OWD
Notes:
• You can create up to 500 roles for your organization
• Every user must be assigned to a role, or their data will not display in opportunity reports, forecast roll-ups, and other displays based on roles
• All users that require visibility to the entire organization should belong to the highest level in the hierarchy
• It is not necessary to create individual roles for each title at your company, rather you want to define a hierarchy of roles to control access of  information entered by users in lower level roles
• When you change a user’s role, any relevant sharing rules are evaluated to add or remove access as necessary
(34). What is a Sharing Rule?
– Automated rules that grant access to groups of users
– Exceptions to Organization Wide Defaults
– Irrelevant for Public Read/Write organizations
– Levels of Access that can be granted
• Read Only
• Read/Write
Notes:
• Sharing rules should be used when a user or group of users needs access to records not granted them by either the role hierarchy setup or the organization wide default settings.
– Sharing rules open up access whereas organization wide defaults restrict access.
– You can use sharing rules to grant wider access to data. You cannot restrict access below your organization-wide default levels.
• Sharing rules apply to all new and existing records owned by the specified role or group members.
• Sharing rules apply to both active and inactive users.
• When you change the access levels for a sharing rule, all existing records are automatically updated to reflect the new access levels.
• When you delete a sharing rule, the sharing access created by that rule is automatically removed.
• When you transfer records from one user to another, the sharing rules are reevaluated to add or remove access to the transferred records as necessary.
• When you modify which users are in a group or role, the sharing rules are reevaluated to add or remove access as necessary.
• For contact, opportunity and case sharing rules, if the role or group members do not have access to the account associated with the shared contact, opportunity or case the rule automatically gives them access to view the account as well.
• Managers in the role hierarchy are automatically granted the same access that users below them in the hierarchy have from a sharing rule.
• You can edit the access levels for any sharing rule. You cannot change the specified groups or roles for the rule.
(35). Types of Sharing Rules in Salesforce and Explain it?
Account Sharing Rules:
– Based on who owns the account
– Set default sharing access for accounts and their associated cases, contacts, contracts, and opportunities
Contact Sharing Rules:
– Based on who owns the contact (must be associated with an account)
– Set default sharing access for individual contacts and their associated accounts
– Cannot use with: Territory Management and B2I (Person Account) enabled orgs
Opportunity Sharing Rules (EE/UE):
– Based on who owns the opportunity
– Set default sharing access for individual opportunities and their associated accounts
Case Sharing Rules (EE/UE):
– Based on who owns the case
– Set default sharing access for individual cases and associated accounts
Lead Sharing Rules (EE/UE):
– Based on who owns the lead
– Set default sharing access for individual leads
Custom Object Sharing Rules (EE/UE):
– Based on who owns the custom object
– Set default sharing access for individual custom object records
(36). Uses cases for Sharing Rules in salesforce?
– Organizations with organization-wide defaults of Public Read Only or Private can create sharing rules to give specific users access to data owned by other users.
– Cases Sharing Example: To use cases effectively, customer support users must have read access to accounts and contacts. You can create account sharing rules to give your customer support team access to accounts and contacts when working on cases.
– Account Sharing Example: The Western and Eastern Regional Directors need to see all of the accounts created by each others’ sales reps. You can create two public groups – one that includes the Western and Eastern Regional Director roles and one that includes the Western and Eastern Sales Rep roles. Then create an account sharing rule so that records owned by the Western and Eastern Sales Rep group are shared with the group containing the Western and Eastern Regional Director roles.
(37). Best Practices of Creating Contact Sharing Rules?
– Account Org-Wide Default must be set to at least “Public Read Only” in order to set the Contact Org-Wide Default to “Public Read/Write”.
– To share ALL contacts in the system with a group of users or a specific role, create a sharing rule that uses the “All Internal Users” (or “Entire Organization”) public group as the owned by option.
– Use “Roles and Subordinates” over “Roles” where possible to minimize the number of sharing rules.
(38). What is a Public Group?
– A grouping of:
• Users
• Public Groups (nesting)
• Roles
• Roles and Subordinates
– Mixture of any of these elements
– Used in Sharing Rules – for simplification (when more than a few roles need to be shared to)
– Also used when defining access to Folders and List Views
For example, if a new user is assigned a role that belongs to an existing public group, that user will be
automatically added to the public group
(39). What is Manual Sharing?
– Granting record access, one-off basis
– Owner, anyone above owner in role hierarchy and administrator can manually share records
– Available on Contacts, Leads, Cases, Accounts and Opportunity records and Custom Objects
– Like sharing rules, irrelevant for Public Read/Write organizations
(40). What is a Sales Team? (EE/UE)
– Used for collaborative selling
– Used for sharing as well as reporting purposes
– Ad hoc or may use Default Sales Team (defined for user)
– Default Sales Teams may be automatically added to a user’s opportunities
– Who can add a Sales Team?
• Owner
• Anyone above owner in role hierarchy
• Administrator
Adding Default Sales Team Members:
– Click Setup | My Personal Information | Personal Information
Please note that the Professional Edition does NOT have access to the Team Selling Feature.

(42). What is an Account Team? (EE/UE)

– Used for collaborative account management
– Used for sharing as well as reporting purposes
– Manually added to Account records
– Default Account Teams may be automatically added to a user’s accounts
– Who can add an account team?
• Owner
• Anyone above owner in role hierarchy
• Administrator
Please note that Account Teams are not available for Professional Edition.

(43). What is  Case Team? (EE/UE)

Case teams enable full communication and collaboration on solving customer issues. You can:
– Add teams of users to cases
– Create a workflow for case teams
– Predefine case teams for users
– Determine the level of access
– Administrators can predefine case teams for users and determine the level of access each team member has to a case, such as Read/Write or Read/Only.
 Click Path: Setup | Customize | Cases | Case Teams

(44). What are Folders?

– Used for organizing email templates, documents, reports and dashboards
– Access is defined – Read or Read/Write
– Access is explicit – does NOT roll up through role hierarchy
Notes:
– You can modify the contents of a folder if the folder access level is set to Read/Write.
– Only users with the “Manage Public Documents” or “Manage Public Templates” can delete or change a Read Only folder.
– The Documents tab does NOT contain version control capabilities
– To search documents, users must use Documents search. The sidebar search does NOT search Documents, Solutions, Products, and Reports but does search Assets and Custom Objects
– The Create New Folder link will only be visible to users with the “Manage Public Documents” permission
– The size limit for documents uploaded is 5MB. The size limit for document filenames is 255 characters including the file extension

(45). What is Workflow?

Salesforce Workflow gives you the ability to automatically:
– Create and send email alerts
– Create and assign tasks
– Update field values to either specific values, or based on formulas
– Create and send outbound API messages
– Create and execute time-dependent actions
Workflow Important Points:
• Your sales organization operates more efficiently with standardized interal procedures and automated business processes – workflow.
• You can set up Salesforce to automatically send email alerts, assign tasks, or update field values based on your organization’s workflow.
• Workflow rules can be used to assign follow-up tasks to a support rep when a case is updated, send sales management an email alert when a sales rep qualifies a large deal, change the owner of a contract when it has been signed by the customer, or trigger an outbound API message to an external HR system to initiate the reimbursement process for an approved expense report.

(46). What are Workflow Components available?

Workflow consists of the following components:
– Workflow Rules – trigger criteria for performing various workflow actions
– Workflow Tasks – action that assigns a task to a targeted user
– Workflow Email Alerts – action that sends an email to targeted recipients
– Workflow Field Updates – action that updates the value of a field automatically
– Workflow Outbound Messages – action that sends a secure configurable API message (in XML format) to a designated listener (not covered in this class)
Notes:
• Workflow Rules use workflow actions when their designated conditions are met. Workflow rules can be triggered any time a record is saved or created, depending on your rule settings. However, rules created after saving records do not trigger those records retroactively.
• Workflow Tasks are like task templates, containing the information a workflow rule uses to assign a task to specified users whenever specific business actions trigger the rule. Workflow tasks provide the Subject, Status, Priority, and Due Date for the tasks a rule assigns.
• Workflow Email Alerts are emails generated by a workflow rule using an email template. The emails are sent to designated recipients, either Salesforce users or others, whenever specific business actions trigger a workflow rule.
• Workflow Field Updates specify the field you want updated and the new value for it. Depending on the type of field, you can choose to apply a specific value, make the value blank, or calculate a value based on a formula you create.
• Workflow Outbound Messages send the information you specify to an endpoint you designate, such as an external service. An outbound message sends the data in the specified fields in the form of a SOAP message to the endpoint.

(47). What is a Workflow Rule?

– Defined trigger criteria based on your business requirements
– Evaluated when record is created, when created/updated, OR when created/updated and did not previously meet trigger criteria
– When trigger criteria is met workflow actions, such as email alerts, tasks, field updates, or outbound messages are generated
To get started using workflow rules, click
• Setup | Create| Workflow & Approvals | Workflow Rules

(48). What is a Workflow Task?

– When a Workflow Rule is met, a Task may be assigned to designated users to follow-up and respond to the Business Conditions in the Workflow Rule
– Workflow Tasks may be assigned to a user, role, record owner, record creator, sales team role, or account team
– Tracked in Activity History and can be reported on
– Can be re-used within the same object
– Tasks can be immediate or time-dependent
To create your workflow tasks:
Click Setup | Customize | Workflow & Approvals | Tasks

(49). What is a Workflow Alert?

– Workflow Alerts are emails generated by a workflow rule whenever specific Business Actions trigger the rule
– Can send alerts to Users, Roles, Customer in a Contact Field, Email Field on Page Layout – please see picklist for options…
– Not tracked in Activity History
– Can be re-used within the same object
– Alerts can be immediate or time-dependent

(50). What is a Workflow Field Update?


– Field updates allow you to automatically change the value of a field to a value you specify
– Depending on the type of field you can:
• apply a specific value
• make the value blank
 calculate a value based on a formula you create
– Field updates can be immediate or time-dependent