How to get picklist values based on record type in Visualforce page?

Visualforce page:

<apex:page controller="Sample">
    <apex:form >
        <apex:inputField value="{!objEmp.Approval_Status__c}"/>
        <apex:inputField value="{!objEmp1.Approval_Status__c}"/>

Apex Class:

public with sharing class Sample { 
    public Employee__c objEmp {get;set;}
    public Employee__c objEmp1 {get;set;}
    public Sample() {
        objEmp1 = new Employee__c(RecordTypeId = '0120P000000EDfb');
        objEmp = new Employee__c(RecordTypeId = '0120P000000EDfg');


Record Type which has one value

Record Type which has multiple values

System and User Date and Date Time in Salesforce

Sample Code:

system.debug('System Date - ' + + ' Or ' +;
system.debug('User Locale Date - ' + + ' Or ' +;
system.debug('System Date Time - ' + + ' Or ' +;

system.debug('User Locale Date Time - ' + + ' Or ' +;


Service not found at: /lapi/record-ui/ salesforce

Check the URL in the request to fix this issue.

Sample Successful Request:

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.

To link Trailhead & Webassessor accounts, check the below link

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

Sample SOQL:

SELECT ValidationName, Active, EntityDefinition.DeveloperName FROM ValidationRule

When you use Developer Console, use Tooling API to query.

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."

1. For Salesforce, the Default Scopes should be refresh_token full. 

2. For Microsoft, use openid offline_access as the Default Scopes.

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 a 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

Use the Language Selector component to multilingual sites to let guest users select their preferred language on public site pages.

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
1. Go to Snap-Ins.

2. Click New button.

3. Enter and select details and click "Create" button.