How to retrieve the Record Type which are accessible by user's Profile only?

Sample Code:

         List < SelectOption > listRecTypes = new List < SelectOption >();
        for ( RecordTypeInfo info: Opportunity.SObjectType.getDescribe().getRecordTypeInfos() ) {
            if(info.isAvailable()) {
                listRecTypes.add(new SelectOption(info.getRecordTypeId(), info.getName()));

The above code will add only the record type accessible to the user.


How to merge all your badges from different account to one account in Salesforce Trailhead?

To merge all your badges from different account to one account in Salesforce Trailhead, check the below link

Make sure you have the usernames of the accounts which are to be merged.


How to query all Validation Rules with object names in Salesforce?

Sample SOQL:

SELECT ValidationName, Active, EntityDefinition.DeveloperName FROM ValidationRule

For more fields, check the below link


History Tracking for Users records in Salesforce

User History related list is not available in Salesforce as of now.

You can use Feed Tracking temporarily -

If users Role, Profile, Active checkbox, and email are changed, you can track the changes from Audit History -

Keep watching the below Salesforce Idea


How to remove Unresolved emails from My Tasks in Home page in Salesforce?

1. Go to Email to Salesforce.

2. Disable Email to Salesforce.


Difference between CRUD, FLS and Sharing in Salesforce

CRUD limits which tabs (or objects) a user can access.

FLS limits which columns (or fields on an object) a user can access.

Sharing limits which rows (or object records) a user can access.

Default Sharing Settings

Check the below link for more info


How to find Duplicates in Salesforce Lightning Experience


The authentication provider didn't provide a refresh token. If the access token expires, your org won't be able to access this named credential.

If you face the below issue in Named Credential, make sure Default Scope is set in Auth. Provider.

"The authentication provider didn't provide a refresh token. If the access token expires, your org won't be able to access this named credential."


My journey to Salesforce Certified Platform Developer II certification exam

The Salesforce Certified Platform Developer II program is designed for individuals who would like to demonstrate their skills and knowledge in advanced programmatic capabilities of the platform and data modeling to develop complex business logic and interfaces. The candidate can design, develop, test, and deploy programmatic solutions that are maintainable and re-usable and follow design patterns and object-oriented programming best practices.

It has the below three levels to get certified from Salesforce.

Level 1 - Multi Choice Questions (60 questions)

This exam is prerequisite for the Programming Assignment and Essay exams. Passing Score is 63% i.e. you must answer at least 40 questions correctly out of 60 questions. Time allotted to complete the exam is 120 minutes.

Tips for the level1 exam.

1. Apex Development
2. Visual Force Development
3. Test Class best practices
4. Apex Trigger best practices
5. SOQL and SOSL
6. Order of execution in both VF and Apex
7. Governor Limits
8. Exception Handling
9. Do the Mock Test given on -

Level 2 - Programming Assignment

Register for this exam only when you are ready. Do not register if you are going to be busy during the exam schedule. We get 30 days to complete the assignment. Spend at least 4 hours each day.

Check the Programming Assignment schedule date here -

The Salesforce Certification Programming Assignment asks each candidate to develop a working application using the capabilities of the platform. Each application should meet the identified business and technical requirements outlined in this document.

The final application should be developed in a sandbox and deployed to the production organization provided. Candidates should consider this application to be a working prototype, rather than a market-ready application. To minimize development time, the requirements are intentionally limited in scope.

Below are the important things to be considered while developing the application.

1. Make sure the code uses DML and SOQL efficiently.
2. The solution should consider data access and visibility.
3. Code should catch all possible errors/exceptions in the controller.
4. Code readability should be excellent.
5. Visualforce page should display user-friendly error messages.
6. The test class should assert application behavior in all cases.
7. Make sure governor limits are considered.
8. Try 100% code coverage.
9. Test class should consider large data volumes.
10. Use proper comments in the code.
11. Use proper indentation in the code.
12. Do all the development in the Sandbox.
13. Load multiple dummy records with proper values in both Sandbox and Production. Use data loader to load bulk data.
14. Bulkify the trigger.
15. User Test Utility class for test data.
16. Use trigger handlers for triggers.
17. Use proper naming for variables, triggers, pages and other components.

Start the application development on the Day 1 of the assignment receival. Do not wait for the last week. Trust me, this is not an easy exam.

Level 3 - Essay Exam

Essay exam is purely based on the assignment work. Do not miss the due date for Essay Exam. Essay exam should be completed within the 30 days of programming assignment. So, schedule it accordingly. Do not wait for the last week to schedule the exam. You may not get the pro-metric center appointment if you schedule it at the last moment.

In the essay exam, talk about the below things.

1. How have you designed the application?
2. What are all the best practices applied? Best practices for development, data load, and test classes.
3. Deployment plan.
4. Testing plan.

The wait for results can vary, but typically you can expect to wait around 4-8 weeks to find out. Salesforce gives us a report with our strengths and areas for improvement with detailed explanation.

Links for references: 


Rate Rules in Salesforce Community

Create and modify rate rules to monitor and limit how frequently member-generated content is created in your community. Rate rules protect your community against spammers and bots that attack your community by posting the same message multiple times in a row. You can create rate rules to notify your moderators of suspicious spammer-like behavior or freeze a member on the spot.

1. Select Moderation.

2. Click Rules tab.


Language Picker in Salesforce Community


How to Enable setup and display of reputation levels

1. Go to Community Management.

2. Enable "Enable setup and display of reputation levels" under Preference.


Service Cloud: Snap-ins - Salesforce

With Snap-ins, agents can use contextual customer details from app data to quickly point them to the right solutions.

Add the Snap-in Chat widget to your website so that customers can quickly get answers to their questions by chatting with an agent while browsing your site. Snap-In Chat uses Live Agent, but with a simpler setup. The setup node for snap-ins chat is available only in Lightning Experience.

To set up snap-ins chat, your org must meet these prerequisites:

  1. Lightning Experience must be enabled to set up snap-ins
  2. Service Cloud License
  3. Live Agent License
  4. Live Agent must be enabled in your org
  5. A Live Agent chat button and a Live Agent deployment must be set up and available in your org
  6. A Salesforce Community (preferable) or a site must be set up on your org and available for guest user access


Community User Visibility in Salesforce

If enabled, users in the same community can see each other regardless of OWD.


How to upgrade templates in Community Cloud in Salesforce?


Salesforce Interview Questions with Answers Part 41

1. Manage Salesforce Knowledge Permission Not found

2. Article Actions

By default, users with the Manage Articles permission can perform all the actions like edit, delete and publish. To restrict access, first create public groups containing article managers and then 

use this page to assign the groups to specific article actions. Using this Article Actions page and Public Groups to manage permissions is only applicable to Knowledge in Salesforce Classic. 

Permissions in Lightning Knowledge are managed via Profile permissions.

3. What are all the advantages of FuseIT Explorer?

2. Retrieve Metadata
3. Deploy Metadata
4. Anonymous Apex
5. Test Execution

4. How to increase Salesforce custom object limitation?

As per the below link, the custom object limit can be increased by Salesforce Account Executive.

5. How to query all private reports in Salesforce?

6. How to delete files attached to FeedComment after deleting FeedIComment in Salesforce?

Feed Item -

7. LockerService For Lightning Components

8. Salesforce Console Integration Toolkit

9. Disadvantage of Quick Create in Salesforce?

It doesn't enforce required fields or trigger validation rules.

10. Omni-channel in Salesforce

11. System.QueryException: Aggregate query has too many rows for direct assignment, use FOR loop

12. API Usage Notifications in Salesforce

13. Set Up Governor Limit Email Warnings in Salesforce


Set Up Governor Limit Email Warnings in Salesforce

To set up Governor Limit Email Warnings, check the below steps.

1. Log in to Salesforce as an administrator user.

2. From Setup, enter Users in the Quick Find box, then select Users.

3. Click Edit next to the name of the user to receive the email notifications.

4. Select the Send Apex Warning Emails option.

5. Click Save.

You can specify users in your organization to receive an email notification when they invoke Apex code that surpasses 50% of allocated governor limits.


API Usage Notifications in Salesforce

When you create a request usage notification, you specify an administrator to receive an email notification whenever your organization exceeds a specified limit for the number of API requests made in a specified span of hours.

1. Go to API Usage Notifications.

2. Click New button.

3. Select the system admin who should get the notification and save it. Once the threshold percentage is exceeded, a notification is sent once per the number of hours specified, until the limit is no longer exceeded.

Maximum 10 notification requests can be added.


System.QueryException: Aggregate query has too many rows for direct assignment, use FOR loop

In order to avoid System.QueryException: Aggregate query has too many rows for direct assignment, use FOR loop, make sure the sub query is limited. If the sub query returns more records, we get System.QueryException: Aggregate query has too many rows for direct assignment, use FOR loop exception.

Sample Incorrect Code:

for ( Account acc : [ SELECT Id, (SELECT Id FROM Contacts) FROM Account ] ) {

Correct Code:

List < Account > lstAcct = [ SELECT Id, (SELECT Id FROM Contacts LIMIT 200) FROM Account ];

for ( Account acc : lstAcct ) {


Home page component disappears on tabs and detail pages

1. Go to User Interface.

2. Enable Show Custom Sidebar Components on All Pages.


How to deploy process builder using Apache ANT Tool in Salesforce?

Sample package.xml:

<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="">


The Default Workflow User must be set before activating this workflow rule

1. Go to Process Automation Settings.

2. Set the Default Workflow User.


How to add Record List component in Salesforce Community Builder?

1. Drag and Drop Record List component.

2. Set the properties for the component.


How to enable Sub Topics in Salesforce Community?

You can hide subtopics in Community Builder. Go to the Page Editor, and select the Topic Detail page. Choose the Headline component, and in the Property Editor deselect Show Subtopics.


How to mention multiple test classes in RunSpecifiedTests in ANT in Salesforce migration?

Sample code in Build.xml:

<target name="deployProdSpecificTest">
<sf:deploy username="${sf.produsername}" 


Omni-Channel in Salesforce

Omni-Channel is a comprehensive customer service solution that lets contact centers push work to their agents in real time. Omni-Channel lets you create work items from your Salesforce records―including cases, chats, leads, and custom objects―and route them to the most qualified, available agents in your organization, all in real time. Omni-Channel integrates seamlessly into the Salesforce console, so it’s easy for your support agents to use.

With Omni-Channel, you can manage the priority of work items to make sure that critical assignments get taken care of quickly. You can manage your agents’ capacity and availability for work to ensure that they’re given only the number of assignments that they can handle. You can also define which agents can work on different types of assignments. Best of all, Omni-Channel routes all of these assignments to the correct agents automatically. Agents no longer have to pick and choose work items manually from a queue, and managers no longer have to triage or dispatch work to agents. Work is served to the most qualified available agent in real time!

1. Go to Omni-Channel Settings.

2. Enable Omni-Channel.

3. Go to Service Channels.

4. Click New.

5. Enter the information and click Save.

6. Go to Routing Configuration.

7. Click New.

8. Enter the information and click Save.

9. For testing purpose, create a queue with the name High-Priority Cases.

10. Go to Presence Statuses.

11. Click New.

12. Enter the information and click Save.

13. Go to a profile where you want to test. Click Edit in Enabled Service Presence Status Access.

14. Save Enable Service Presence Status Access.

15. Edit a Console app and Add Omni Channel Console Component Salesforce.

16. Open the console app. Create a case with priority High. Change the owner to High Priority Cases queue. Accept the case. It will change the owner as you.


Welcome New Member email settings in Salesforce Community


Portal User Visibility in Salesforce

If enabled, portal users in the same customer or partner portal account can see each other, regardless of the organization-wide defaults.


Salesforce Chatter Answers to Retire in Winter ’18

With the Winter ’18 release, Salesforce will no longer support Chatter Answers, and users of Chatter Answers will no longer be able to post, answer, comment, or view any of the existing Chatter Answers data. Customers will have until the Winter ’18 release to complete their transition to Chatter Questions.

Chatter Answers is a Questions and Answer (Q&A) feature that allows users to post questions and receive answers and comments from other users or support agents. The functionality is used within portals, Communities, or internally as a separate object within your Salesforce org.

NOTE: Chatter Answers is unavailable for new orgs created with or after the Summer ’16 release. Such customers will need to use Chatter Questions.

Check the below link for more information


How to use custom fields on Add Opportunity Splits page?

1. Go to Opportunity Split --> Fields.

2. Click New and create a custom field.

3. Go to Opportunity Split --> Page Layouts.

4. Edit a layout and select Edit Multi-Line Layout.

5. Add the field and Save it.



How to redirect user to record detail page from Visualforce page in Salesforce Console?

Sample Code:

public PageReference redirect() { 
    String acctId = ApexPages.currentPage().getParameters().get('acc');
    PageReference pr = new PageReference('salesforce_url/console#%2F' + accId);
    return pr; 


Salesforce Console Integration Toolkit

The Salesforce console is designed for users in fast-paced environments who need to find, update, and create records in Salesforce quickly. The Salesforce Console Integration Toolkit provides you with programmatic access to the Salesforce console so that you can extend it to meet your business needs. With the Salesforce Console Integration Toolkit, you can open and close tabs in the console to streamline a business process. For example, the toolkit lets you integrate third-party systems with the console, opening up an external application in the same window, in a tab.

1. Create a Visualforce page with the below code.

Sample Visualforce page:

<apex:page standardController="Case">

    <apex:includeScript value="/support/console/39.0/integration.js"/>
    <script type="text/javascript">
        /* Opens Case's Contact in primary tab */
        function openPrimaryTab() {
            '{!$Site.BaseUrl}/{!Case.Contact.Id}', true, 'Contact');

        /* Opens Case's Contact in sub tab */
        var callOpenSubtab=function callOpenSubtab(result) {
            '{!$Site.BaseUrl}/{!Case.Contact.Id}', true, 'Contact');

        function openSubtab() {

        //Sets the title of the current tab to "Example"
        function setTitle() {

        //The callback function that closeTab will call once it has the ID for its tab
        var callCloseTab= function callCloseTab(result) {

        function closeTab() {

    <A HREF="#" onClick="openPrimaryTab();return false">Open A Primary Tab</A> 
    <p/><A HREF="#" onClick="openSubtab();return false">Open A Subtab</A> 
    <p/><A HREF="#" onClick="setTitle();return false">Set Title to Example</A> 
    <p/><A HREF="#" onClick="closeTab();return false">Close This Tab</A> 


2. Go to Buttons, Links, and Actions under Case.

2. Click "New Button or Link".

3. Save it.

4. Add it to the Case page layout.

5. Open a Case record and Click the link.

Set Title to Example:

Open A Subtab:

Open A Primary Tab: