Symbol datatype in JavaScript

Symbols are new primitive type added in ECMAScript 2015. Symbols do not have a literal syntax, they have a Symbol() function that can be used to create them.

Symbols are unique. Each new symbol has a new, unique value.
Symbol() === Symbol() // false

1. Symbols may be used as unique property keys. They prevent name clashes.
2. They may be used as constants representing concepts.
const CATEGORY_PHONES = Symbol('phones');

Difference between null and undefined in JavaScript

null and undefined are similar and both mean an absence of value. They are considered equal by the equality operator (==).
console.log(null == undefined); // true

To distinguish them the strict equality operator (===) should be used.
console.log(null === undefined); // false

The main difference between them is that undefined represents an unexpected absence of value and the value of a variable should not be set to undefined. null, however, represents normal, expected absence of value and if there is no value, the value of the variable can be set to null.

What is the Difference between var and let in JavaScript?

var keyword
Variables declared with the var keyword can not have Block Scope.
Variables declared inside a block {} can be accessed from outside the block.
Variables can be referred to before the declaration.


  var x = 2; 
// x CAN be used here

document.write( x );//undefined
var x = 9;
document.write( x );//9

let keyword
Variables declared with the let keyword can have Block Scope.
Variables declared inside a block {} cannot be accessed from outside the block.
Variables cannot be referred to before the declaration.

  let x = 2;
// x can NOT be used here

document.write( x );//throw an error
let x = 9;
document.write( x );//9

How to update contacts using Account and Contact names in Salesforce?

Use Account Name and Contact Name.

Resource Guide for Salesforce Field Service Lightning Consultant

Field Service Lightning in Salesforce lets customer service teams delegate work to field service technicians and monitor them and lets the latter access customer records in the field.

“Field Service Lightning connects your entire workforce on one platform to deliver smarter, faster, more personalized on-site service to your customers.”

Links for certification preparation:

Trailhead Trailmix -

Salesforce Help Resource -

How to enable Field Service in Salesforce? -

Create Work Orders -

Salesforce Disaster Recovery

Salesforce has disaster recovery plans in place and tests them at least once per year. The Salesforce Services utilize secondary facilities that are geographically remote from their primary data centers, along with required hardware, software, and Internet connectivity, in the event Salesforce production facilities at the primary data centers were to be rendered unavailable.

The Salesforce Services’ disaster recovery plans currently have the following target recovery objectives: (a) restoration of the Salesforce Service within 12 hours after Salesforce’s declaration of a disaster; and (b) maximum Customer Data loss of 4 hours; excluding, however, a disaster or multiple disasters causing the compromise of both data centers at the same time, and excluding development and test bed environments, such as the Sandbox service.

Source -

Salesforce maintains a copy of customer data for disaster recovery purposes, but it is important for customers to develop a data backup and recovery strategy as part of their overall data management and security model. The Salesforce Data Recovery service is an expensive and time-consuming process and should only be used as a last resort, when no other copy of the data is available.

Hourly limit exceeded for processing workflow time triggers

1,000 workflow time triggers per hour is the current Salesforce limit for time trigger actions.

If you have 1100 time trigger actions to be executed between 7am and 8am, Salesforce executes 1000 between 7am and 8am and remaining 100 after 8am. Once the limit is reached Salesforce defers processing and resumes in the next our.

Salesforce limits the number of total and active rules in your org, the number of time triggers and actions per rule. It also processes a limited number of daily emails and hourly time triggers.

When workflows approach or exceed certain limits, Salesforce sends a warning email to the default workflow user or if the default workflow user isn't set then to an active system administrator.

HourlyTimeBasedWorkflow from OrgLimits.getAll() can give you the current limit.

Even though the limit is 1000, in my org it was set it to 50. Raise Salesforce support ticket to increase the limit.

Check the below link for more limits

Why Salesforce Lightning Web Component is open source?

Lightning Web Components framework doesn’t have dependencies on the Salesforce platform. Instead, Salesforce-specific services are built on top of the framework. What that layered architecture means is that you can now use the Lightning Web Components framework to build web apps that run anywhere.

In the past, developers often had to use different frameworks to build different sides of an application. For example, you’d use Aura to build the employee-facing side of an application on Salesforce and React, Angular or Vue to build the customer engagement side of the application on Heroku or any other platform. Today, you can use Lightning Web Components to build both sides of the application. The benefits are significant: you only need to learn a single framework and you can share code between apps. And because Lightning Web Components is built on the latest web standards, you know you are using a cutting-edge framework based on the latest patterns and best practices.

Opportunity Age and Stage Duration in Salesforce

For an open opportunity, the number of days since the opportunity was created. For a closed opportunity, the number of days between the creation date and the closed date.

Stage Duration
Stage Duration is the total number of days an opportunity is in a particular sales stage, specifically from the date when the opportunity changed to current stage until today.

1. Available only through standard reports.
2. We cannot add it to the page layout.

How to close the quick action popup and refresh the page from custom Salesforce Lightning Component?

Use the below methods to close the quick action popup and refresh the page from custom Salesforce Lightning Component.



Sample code:


  1. <aura:component implements="force:hasRecordId,force:lightningQuickActionWithoutHeader" controller="Sample" >  
  3.     <div class="slds-box slds-theme_default">   
  4.         <ui:button aura:id="mybtn" class="slds-button slds-button--brand slds-size--1-of-1" label="Testing" press="{!c.onclick}" />  
  5.     </div>  
  7. </aura:component>  

Component Controller:

  1. ({      
  3.     onclick : function(component, event, helper) {  
  5.         var action = component.get( "c.firstMethod" );  
  6.         action.setCallback(this, function(response){  
  7.             var state = response.getState();  
  8.             if (state === "SUCCESS") {  
  10.                 alert( response.getReturnValue() );  
  11.                 $A.get("e.force:closeQuickAction").fire();  
  12.                 $A.get('e.force:refreshView').fire();  
  14.             }  
  15.         });  
  16.         $A.enqueueAction(action);  
  18.     }  
  20. })  

Apex Class:

  1. public class Sample {  
  3.     @AuraEnabled  
  4.     public static String firstMethod() {  
  5.         return 'Success';  
  6.     }  
  8. }  


How to use ternary operator in Visualforce page?

Visualforce page doesn't support ternary operator. But, Apex support.

Visualforce page supports IF function. We can achieve the same using this.


IF ( logical_test, value_if_true, value_if_false )


{! IF( Account.Size__c == null, '10', Account.Size__c ) }

In the above example, if the Account's Size is null, it will default to 10. Else, it will display the Account's size.

@AuraEnabled( cacheable = true )

To improve runtime performance, set @AuraEnabled(cacheable=true) to cache the method results on the client. To set cacheable=true, a method must only get data. It can’t mutate data.

Marking a method as storable improves your component’s performance by quickly showing cached data from client-side storage without waiting for a server trip. If the cached data is stale, the framework retrieves the latest data from the server. Caching is especially beneficial for users on high-latency, slow, or unreliable connections, such as 3G networks.

Prior to Winter ’19, to cache data returned from an Apex method, you had to call setStorable() in JavaScript code on every action that called the Apex method. Now you can mark the Apex method as storable (cacheable) and get rid of any setStorable() calls in JavaScript code.

Example -

Simple lightning-datatable using Lightning Web Component LWC in Salesforce

Component HTML:

  1. <template>  
  3.     <lightning-card title = "Search Accounts" icon-name = "custom:custom63">  
  5.         <div class = "slds-m-around_medium">  
  7.             <lightning-input type = "search" onchange = {handleKeyChange} class = "slds-m-bottom_small" label = "Search" >  
  8.             </lightning-input>  
  10.             <template if:true = {accounts}>  
  12.                 <div style="height: 300px;">  
  14.                     <lightning-datatable key-field="id"  
  15.                                          data={accounts}  
  16.                                          columns={columns}  
  17.                                          hide-checkbox-column="true"  
  18.                                          show-row-number-column="true">  
  19.                     </lightning-datatable>  
  21.                 </div>                   
  23.             </template>  
  25.             <template if:true = {error}>  
  27.                 {error}>  
  29.             </template>  
  31.         </div>  
  33.     </lightning-card>  
  35. </template>  


  1. import { LightningElement, track } from 'lwc';  
  2. import fetchAccounts from '@salesforce/apex/AccountController.fetchAccounts';  
  4. const columns = [  
  5.     { label: 'Id', fieldName: 'Id' },  
  6.     { label: 'Name', fieldName: 'Name' },  
  7.     { label: 'Industry', fieldName: 'Industry' },  
  8. ];  
  10. export default class accountSearchLWC extends LightningElement {  
  12.     @track accounts;  
  13.     @track error;  
  14.     @track columns = columns;  
  16.     handleKeyChange( event ) {  
  18.         const searchKey =;  
  20.         if ( searchKey ) {  
  22.             fetchAccounts( { searchKey } )    
  23.             .then(result => {  
  25.                 this.accounts = result;  
  27.             })  
  28.             .catch(error => {  
  30.                 this.error = error;  
  32.             });  
  34.         } else  
  35.         this.accounts = undefined;  
  37.     }  
  39. }  

Apex Class:

  1. public with sharing class AccountController {  
  3.     @AuraEnabled( cacheable = true )  
  4.     public static List< Account > fetchAccounts( String searchKey ) {  
  6.         String strKey = '%' + searchKey + '%';  
  7.         return [ SELECT Id, Name, Industry FROM Account WHERE Name LIKE: strKey LIMIT 10 ];  
  9.     }  
  11. }