Salesforce Interview Questions with Answers Part 57

Salesforce Interview Questions with Answers Part 57

1. Splunk and Salesforce

Install Splunk App for Salesforce using the below URL.

We can check the below

1. Apex Pages performance
2. Apex Classes performance
3. Detect Security Threats
4. Reports and Dashboards usage and performance
5. Trigger Chatter feed to a group in Salesforce

2. What is a crosswalk table?

Crosswalk table is a reference table which gets all the columns from two or more different tables.


ID   | Name     | Address     | Zip   | PhoneNumber
IN11 | Brad Bob | 763 Park St | 25896 | 999-789-1234


ID   | Name     | Address     | Zip   | PhoneNumber
IN22 | Brad Bob | 763 Park St | 25896 | 999-789-1234

Sample Crosswalk

Table1ID | Table2ID
IN11     | IN22

SELECT Table1.ID AS Table1ID, Table2.ID AS Table2ID
FROM Table1
INNER JOIN Table2 ON Table1.Name = Table2.Name
  AND Table1.Address = Table2.Address
  AND Table1.Zip = Table2.Zip
  AND Table1.PhoneNumber = Table2.PhoneNumber

3. Why 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.

4. Difference between Primary tab and Subtab in Salesforce Service Console

Primary Tab 
Primary tabs are the records opened from searches and list views.

Subtabs display related records opened from within the open primary tab you are already working from.

Example: If you have a case open and click on the name of the Opportunity, the Opportunity record will open in a sub-tab.

5. How to access Metrics for Your Visualforce Pages in Salesforce?

Using VisualforceAccessMetrics, you can track the number of views each Visualforce page in your org receives in a 24-hour time period. To find out how many views a page got over the course of multiple days, you can query multiple VisualforceAccessMetrics objects for the same ApexPageId.

SELECT ApexPageId, ApexPage.Name, DailyPageViewCount, Id, ProfileId, MetricsDate, LogDate FROM VisualforceAccessMetrics ORDER BY ApexPage.Name

LogDate provides the date that the page access was logged. This parameter is available for release 216 and later.

ProfileId is the ID of the profile associated with the users who accessed the page. This parameter is available for release 216 and later.

ApexPageId is the ID of the tracked Visualforce page.

DailyPageView tracks the daily page view count in the DailyPageViewCount field.

MetricsDate is the date the metrics were collected is specified in MetricsDate.

Page views are tallied the day after the page is viewed, and each VisualforceAccessMetrics object is removed after 90 days.

6. Salesforce Scope Parameter

Salesforce uses below scopes.

api – Allows access to the current, logged-in user’s account using APIs, such as REST API and Bulk API. This value also includes chatter_api, which allows access to Chatter REST API resources.

chatter_api – Allows access to Chatter REST API resources only.

custom_permissions – Allows access to the custom permissions in an organization associated with the connected app, and shows whether the current user has each permission enabled.

full – Allows access to all data accessible by the logged-in user, and encompasses all other scopes. full does not return a refresh token. You must explicitly request the refresh_token scope to get a refresh token.

id – Allows access to the identity URL service. You can request profile, email, address, or phone, individually to get the same result as using id; they are all synonymous.

openid – Allows access to the current, logged in user’s unique identifier for OpenID Connect apps.

Use the openid scope in the OAuth 2.0 user-agent flow and the OAuth 2.0 web server authentication flow to receive a signed ID token conforming to the OpenID Connect specifications in addition to the access token.

refresh_token – Allows a refresh token to be returned when you are eligible to receive one. Then the app can interact with the user’s data while the user is offline, and is synonymous with requesting offline_access.

visualforce – Allows access to customer-created Visualforce pages. Doesn’t allow access to standard Salesforce UIs.

web – Allows the ability to use the access_token on the web, and includes visualforce, allowing access to customer-created Visualforce pages.

Reference Link –

7. Streaming API Notifications Sent in Reverse Order Within a Transaction

In general, event notifications are delivered in the order of record changes. One exception is that when a record triggers multiple notifications within the same transaction, the last notifications are delivered first.
For example, let’s say you have a PushTopic for insertions and updates of contact records, and the PushTopic query selects fieldA. If a contact is inserted and then an Apex trigger or workflow updates fieldA in the same transaction, the order of notifications sent is:

Notification for the update of fieldA
Notification for the insertion of the record
In this case, the order of notifications depends on the order in which the Lightning Platform commits transactions.

8. What is the use of Sharing Set in Salesforce Community?

A sharing set gives community users access to records that are associated with their accounts or contacts based on their user profiles.

The Available Objects list excludes:

Objects with an organization-wide sharing setting of Public Read/Write
Custom objects that don’t have an account or contact lookup field

9. lightning:relativeDateTime

When you provide a timestamp or JavaScript Date object, lightning:relativeDateTime displays a string that describes the relative time between the current time and the provided time.

10. How to use WHERE condition in SOSL?

public class SOSLController {

    public static List < List < SObject > > searchAccountContactLead( String strSearch ) {
        String searchQuery = ‘FIND ” + strSearch + ‘*’ IN ALL FIELDS RETURNING Account( Id, Name WHERE Industry = ‘Apparel’ ), Contact, Lead’;
        return search.query( searchQuery );

11. @AuraEnabled( cacheable = true )

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.

12. Adding SOSL Queries to Unit Tests

To ensure that test methods always behave in a predictable way, any Salesforce Object Search Language (SOSL) query that is added to an Apex test method returns an empty set of search results when the test method executes. If you do not want the query to return an empty list of results, you can use the Test.setFixedSearchResults system method to define a list of record IDs that are returned by the search. All SOSL queries that take place later in the test method return the list of record IDs that were specified by the Test.setFixedSearchResults method. Additionally, the test method can call Test.setFixedSearchResults multiple times to define different result sets for different SOSL queries. If you do not call the Test.setFixedSearchResults method in a test method, or if you call this method without specifying a list of record IDs, any SOSL queries that take place later in the test method return an empty list of results.

The list of record IDs specified by the Test.setFixedSearchResults method replaces the results that would normally be returned by the SOSL query if it were not subject to any WHERE or LIMIT clauses. If these clauses exist in the SOSL query, they are applied to the list of fixed search results.

1. Although the record may not match the query string in the FIND clause, the record is passed into the RETURNING clause of the SOSL statement.
2. If the record matches the WHERE clause filter, the record is returned. If it does not match the WHERE clause, no record is returned. 

13. Sales Cadences in Salesforce

For reps, sales cadences bring together all their pending activities in one view and log activities as reps complete them. After reps start using sales cadences, managers can report on which cadences result in the best sales outcomes.

For example, a sales manager can guide reps to make two back-to-back calls to the prospect, wait half a day, and then call again or send an email. This sequence is a best practice for optimizing prospecting results.

It is available with High Velocity Sales, which is available for an extra cost.

For more information check

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

15. DUPLICATE_VALUE, duplicate value found: <unknown> duplicates value on record with id

Check whether you are affected by this known issue – If yes, contact Salesforce support.

DML Error
If you’re getting this error from a DML operation, then check the below

1. Check whether there are any fields with Unique attribute selected. If yes, check whether you are entering unique value to this field while doing data loading. Also, check whether any processes are updating this unique field value. Setting debug log, helps to find it or search through the metadata.
2. Check this –

Deployment Error
If you’re getting this error while trying to deploy. then check the below

1. Check whether there are any fields with Unique attribute selected. If yes, check whether test class is creating unique value for these fields.
2. Check whether you are trying to deploy picklist field. If yes, make sure the value is not inactive in the target org.

16. What’s an Integrated Development Environment (IDE)? 

Typically, it’s a program that gives developers a collection of tools including source code editor, build automation, and debugging.

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


18. 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 hour.

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.

Check the below link for more limits

Leave a Reply