salesforce interview questions and answers 12

Part 1 (1-15) - Part 2 (16 -30) - Part 3 (31 -45) - Part 4 (46 -55) - Part 5 (56 -66) - Part 6 (67 - 78) - Part 7 (79 - 90) - Part 8 (91 - 100) - Part 9 (101- 111) - Part 10 (112 - 120) - Part 11 (121 - 130) - Part 12 (131 - 137) - Part 13(138 - 145) - Part 14 (146 - 152) - Part 15 ( 153 - 159) - Part 16 ( 160 - 168) Part 19 (188 - 201)
131. Can you create sharing rules for detail objects?
Ans - No. Detail objects cannot have sharing rules as the detail objects do not have owner field with them.

132. How can view state error be avoided?
Ans - Use transient keyword with variables wherever possible, clear unused collections. Use 1 form tag in a visualforce page.

133.Consider that a record meets a workflow criteria for time based workflow action, the action goes in queue . Later, before the time based action is triggered, the same record gets modified and the criteria previously met is changed and now it does not meet the workflow criteria, what happens to the time based action placed in queue?
Ans - The time based workflow action is removed from the queue and will not get fired.

Ans - Sharing rules extend the record/data access level which is set using OWD, role hierarchy. Sharing rule cannot restrict the data visibility but can only widen it.

135. Which all field data types can be used as external ids?
Ans -  An external id can be of type text, number or email type

136. What is a mini page layout?
Ans - Mini page layout defines fields and related list to be displayed in hover detail and console tab. Whenever you hover mouse over any recently viewed record the fields are displayed, related list is not displayed(fields can be set in mini page layout). Console tab fields and related list on the right hand side are also controlled by mini page layout.

137. What is the use of console view/console tab?
Ans - Console gives list views and related list records for multiple objects on a single screen without any customisation (visualforce page or controller)

Part 1 (1-15) - Part 2 (16 -30) - Part 3 (31 -45) - Part 4 (46 -55) - Part 5 (56 -66) - Part 6 (67 - 78) - Part 7 (79 - 90) - Part 8 (91 - 100) - Part 9 (101- 111) - Part 10 (112 - 120) - Part 11 (121 - 130) - Part 12 (131 - 137) - Part 13(138 - 145) - Part 14 (146 - 152) - Part 15 ( 153 - 159)- Part 16 ( 160 - 168) Part 19 (188 - 201)

Roles and Profiles in salesforce

Article 1** Article 2** Article 3** Article 4** Article 5** Article 6** Article 7** Article 8** Article 9  ** Article 10
Click Here- To know about Governers Limit In Salesforce
In salesforce, roles are defined so as to increase the data visibility a particular user has. The data visibility can be increased using sharing rules or by building role hierarchy. Role hierarchy allows the user sitting in higher level have access of records owned by users having role lower in hierarchy. It is not mandatory that a user should have a role.

Organisation wide default sets the default access for objects, for example OWD set as private would mean that only the owner of the record can access the record. One way to grant additional access of these records to other users is through roles i.e users higher in role hierarchy would get the access of records owned by users lower in hierarchy. Other way is by writing sharing rules, wherein we can specify the logic to decide which record should be shared and with what role user. We can specify against custom objects whether the records should be shared using role hierarchy or not but this is default set for standard objects and cannot be changed. That is, standard object records will always be shared according to role hierarchy. Defining role for users is not a mandatory thing, however not defining role for a user could affect the data shown on opportunity and other reports for that user.
Summarising the points for role,
1. Role controls the level of record access user has
2. Helps extend the OWD settings for different objects
3. Sharing rules can be written to share records with particular role and subordinates
4. Defining role for user is not mandatory. 

Unlike role,  profile is mandatory for every user in salesforce. You cannot have a user without a profile. It is the building pillar of the entire org. Profile states the objects/field permissions and also other permissions with in the org. It defines what a user can do within the org, it states the access settings and user permissions. Profile controls following -
  • Object permissions [create, delete,read, edit permissions] 
  • field permissions [view, edit]
  • Record type permission 
  • Which Apps can be viewed 
  • Login hours can be defined 
  • Ip address permissions 
  • Which tabs are visible 
  • Which page layouts can be viewed  
  • Classes, vf pages permissions
Salesforce provides some standard profiles with different set of permissions for each, we can create our own profiles to have permissions as per our requirement. New profile should be cloned from existing profile.

Difference between the two can be summarised as below
1. Role defines what user can see depending on the hierarchy(Helps in defining data visibility)
2. Profile defines what a user can do within the org(Defines various permissions)
3. Defining profile for a user is mandatory, role is not.
Article 1** Article 2** Article 3** Article 4** Article 5** Article 6** Article 7** Article 8** Article 9  ** Article 10

Related Articles

Deployment in salesforce using ANT

Follow these steps to deploy using ANT
1. Install ANT on you computer.
  In this step download ANT and set up 'folders' on your computer.
   Download apache ant from Here and also download ant set up from salesforce(Folder: apache-ant-1.9.3). For this go to set up --> Develop --> tools --> click on Migration Tool
ant zipped folder would be downloaded on your computer(Folder: salesforce_ant xx).
 Create new folder "My ANT"(say on dekstop) and paste folder apache-ant-1.9.3 in it. Also, cut files(folder "unpackaged", and both files build files) and paste them in "My ANT" folder.

2. Set up path variable in advanced settings in your computer. For this right click on my computer folder. click properties. click advanced properties --> click advanced tab -->click environment variables button under system variables select path and click on edit. Your path variable will have some parameters just put semicolon after it and then paste the path of bin folder in your apache-ant-1.9.3 after the already existing path variable(put semicolon before the path address ';') i.e your address would look something like this (;C:\Users\username\Desktop\My Ant\apache-ant-1.9.3\bin)
After you have set the correct path click OK so that the change in path variable is saved.

3. Set credentials of the source environment.
   This should be saved in build file of type properties(remember there are two files named build. Credentials should be saved in properties type file)
   Open the file and delete all its content and edit it to save as per following lines
  # my sandbox environment
  sf.serverurl =
  sf.username = Give your user name
  sf.password = Your security token + password

give your server URL appropriately as shown above, then username and password. remember # infront of a line comments it. While you are retrieving the components make sure all other lines are commented except the above 3 lines of source environment.

4.. Identify the retrieve command from Build(Type: XML) file
  Once you have set the credentials its time to find out command from other build file that will help in retrieving the components.
target name "retrieveUnpackaged"  will be the command used to retrieve the components. You can change this name as per your wish in the build xml file

5. Set the components which you wish to retrieve in package xml document.
   We need to define which are the components to be retrieved and then deployed. This needs to be done in package file present in "unpackaged" folder
   Your default package.xml file will have following

   <?xml version="1.0" encoding="UTF-8"?>
    <Package xmlns="">  
above xml code defines all triggers and all classes. A * between member indicates all members. If you wish to retrieve specific trigger or class than its name shoudl be mentioned.
ex:        <members>mytriggeroncontact</members>
 this will retrieve mytriggeroncontact trigger. similarly you will have to put which ever components are required to be retrieved.

6. Retrieve the metadata components you wish to deploy.
  We have defined our source environment creds, defined the required components and have identified the command that will retrieve the components.

7. Retrieve components
 press shift key and right click on "my ant" folder, click open command window here. This will open command window and directly take you to ant folder location.
Next will be giving command to retrieve: type ant retrieveUnpackaged and press enter. This will start the retrieving, once done it creates a folder with name "retrieveUnpackaged" this will contain the components to be deployed.
Components contained in this folder will then be used for deployment.

8. Deploy the retrieved components in to destination environment.
   In the build file type in your destination server url, username, and password. Comment the source creds using # or better remove them from the build file.

9. Give deploy command.
 in command window type ant deployUnpackaged. deployUnpackaged is the command for deployment.(you can change the name as per your wish in the build xml file) Command window will show the status of deployment.