November 12, 2019

Difference between public, private, protected and global access modifiers in Salesforce?

private is the default, and means that the method or variable is accessible only within the Apex class in which it is defined.  If you do not specify an access modifier, the method or variable is private.

We can access global class anywhere irrespective of namespace. If you declare a method or variable as global, you must also declare the class that contains it as global.

Public class is accessible within namespace only.

Protected means that the method or variable is visible to any inner classes in the defining Apex class, and to the classes that extend the defining Apex class. You can only use this access modifier for instance methods and member variables.

Check the below link for more information.
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_access_modifiers.htm

November 11, 2019

What type of customizations can be done on Activities Salesforce?

What type of customizations can be done on Activities Salesforce?

1. Workflow Rules
2. Custom Fields
3. Validation Rules
4. Trigger
5. Field Dependencies
6. Record Type

How to show Record Detail in the side panel with few fields in Salesforce Lightning Record Page?

How to show Record Detail in the side panel with few fields in Salesforce Lightning Record Page?

1. Create an Update action.


2. Add the fields in the action layout.


3. Added Related Record standard lightning component to the lightning record page.

4. Select the Update action created in Step 1.


Salesforce Lightning - Save and Add Products on Opportunity Button

1. Go to Opportunity Settings. Enable Prompt users to add products to opportunities.


2. Now, it presents users with the "Add Products" screen after they click "Save".

Row Lock or Lock Row in Salesforce

When a record is being updated or created, we place a lock on that record to prevent another operation from updating the record at the same time and causing inconsistencies on the data. These locks normally last for a few seconds and when the lock is released, other operations can do whatever processing they are supposed to do on the record in question. However, a given transaction can only wait a maximum of 10 seconds for a lock to be released, otherwise, it will time out.

Check the below link for more information

https://help.salesforce.com/articleView?id=000338933&type=1&mode=1

November 9, 2019

Which Special characters need to be escaped in package.xml in Salesforce ANT deployment?

Which Special characters need to be escaped in package.xml in Salesforce ANT deployment?

You need to escape the below

1. & - ampersand
2. &lt; - less than symbol( < )
3. &gt; - greater than symbol( > )
4. &quot; - quote
5. &apos; - apostrophe

Salesforce Data Skew

When you have a very large number of child records associated to the same parent record in Salesforce, we call that “data skew”.

Types of Salesforce Data Skew
Account Data Skew
Certain Salesforce objects, such as accounts and opportunities, have special data relationships that maintain parent and child record access under private sharing models. If too many child records are associated with same parent object in one of these relationships, this imbalance causes something called “account data skew,” which in turn causes performance problems.

Ownership Skew
Similarly, when a large number of records with the same object type are owned by a single user, this imbalance causes something called “ownership skew.” Ownership skew also causes performance problems, which can surface when you’re managing your role hierarchy and sharing rules.

Lookup Skew
Lookup skew happens when a very large number of records are associated to a single record in the lookup object.  Because you can place lookup fields on any object in Salesforce, lookup skew can create problems for any object within your organization.

November 8, 2019

Salesforce Interview Questions with Answers Part 59

1. Set Checkpoints in Apex Code
Use Developer Console checkpoints to debug your Apex classes and triggers. You can’t set checkpoints in Visualforce markup.

Checkpoints persist until you click Debug --> Clear Checkpoint Locations.

Use checkpoints to investigate the objects in memory at a specific point of execution and see the other objects with references to them.

If you set a checkpoint in a method with the @future annotation, you must keep the Developer Console open until the @future method completes asynchronously.

https://www.infallibletechie.com/2019/11/set-checkpoints-in-apex-code.html

2. Debug Log limit in Salesforce
Each debug log must be 20 MB or smaller. If it exceeds this amount, you won’t see everything you need. Additionally, each org can retain up to 1,000 MB of debug logs. The oldest logs are overwritten.

3. Difference between authorization code, access token, and bearer token?
An auth-code (short for authorization code) is a unique string of random letters and numbers assigned to a domain. When you transfer a domain to another registrar, its auth code is required to start the transfer. This helps prevent domain hijackers from transferring a domain without the owner's permission. Authorization codes must be retrieved from the current domain registrar where the domain is registered.

Access tokens are credentials used to access protected resources. An example of a protected resource is a REST API exposed by Salesforce.

Refresh tokens are credentials used to obtain access tokens. Refresh tokens are issued to the client by the authorization server and are used to obtain a new access token when the current access token becomes invalid or expires.
In order to access an API for example, you need to use an Access Token. Access tokens are short-lived (around an hour). You use the bearer token to get a new Access token.

4. How to reference Custom Metadata Type Record in Salesforce Flows?
Use Get Records flow component to fetch and reference Custom Metadata Type Record in Salesforce Flows.
https://www.infallibletechie.com/2019/10/how-to-reference-custom-metadata-type.html

5. How to embed a Visualflow in a Visualforce page?
</apex:page>

<flow:interview name="flowuniquename"/>

<apex:page>

6. Why are Visualforce pages served from a different domain?
Visualforce pages are served from a different domain to improve security standards and block cross-site scripting.
If it runs in the same domain, the scripts on the VF page will be able to access the scripts on the standard page-layout and will be able to manipulate it.

7. Troubleshoot network performance issues with ping and traceroute
https://help.salesforce.com/articleView?id=000326878&type=1&mode=1

8. Connection Pool Errors in Salesforce
If you receive the following error message, your organization may experience performance issues and possible service disruptions.

HTTP Status 500
Unable to find a connection to send a request

Causes
This system exception will be raised when your Salesforce organization database is unable to communicate with internal data sources. These limits are determined by your current Salesforce edition (displayed in the title bar of your browser).

Possible connection pool error scenarios:

Inefficient SOQL queries
Insufficiently configured reports, dashboards, and list views

9. Row Lock or Lock Row in Salesforce
When a record is being updated or created, we place a lock on that record to prevent another operation from updating the record at the same time and causing inconsistencies on the data. These locks normally last for a few seconds and when the lock is released, other operations can do whatever processing they are supposed to do on the record in question. However, a given transaction can only wait a maximum of 10 seconds for a lock to be released, otherwise, it will time out.
Check the below link for more information
https://help.salesforce.com/articleView?id=000338933&type=1&mode=1

10. Salesforce Data Skew
When you have a very large number of child records associated with the same parent record in Salesforce, we call that “data skew”.

Types of Salesforce Data Skew
Account Data Skew
Certain Salesforce objects, such as accounts and opportunities, have special data relationships that maintain parent and child record access under private sharing models. If too many child records are associated with the same parent object in one of these relationships, this imbalance causes something called “account data skew,” which in turn causes performance problems.

Ownership Skew
Similarly, when a large number of records with the same object type are owned by a single user, this imbalance causes something called “ownership skew.” Ownership skew also causes performance problems, which can surface when you’re managing your role hierarchy and sharing rules.

Lookup Skew
Lookup skew happens when a very large number of records are associated with a single record in the lookup object.  Because you can place lookup fields on any object in Salesforce, lookup skew can create problems for any object within your organization.

11. Concurrent Apex Errors
If you receive the following error message, your organization may experience performance issues and possible service disruptions.

'Unable to process request. Concurrent requests limit exceeded.'

This system exception will be raised when your concurrent Apex requests exceed governor limitations for your Salesforce organization. These limits are determined by your current Salesforce edition.

If Synchronous Apex runs more than 5 sec it considered a long-running job. And we have a limit that only 10 long-running jobs can execute at a time. So, whenever 11th Synchronous apex tries to execute, it gets Concurrent Apex limit error

Possible concurrent Apex error scenarios:

Poorly coded Apex
Synchronous callouts from Visualforce pages
Inefficient SOQL queries

12. Parameterized Typing in Apex in Salesforce
Apex, in general, is a statically-typed programming language, which means users must specify the data type for a variable before that variable can be used.
This is legal in Apex:
Integer x = 1;

This is not legal if x has not been defined earlier:
x = 1;

13. Difference between public, private, protected and global access modifiers in Salesforce?
private is the default and means that the method or variable is accessible only within the Apex class in which it is defined.  If you do not specify an access modifier, the method or variable is private.

We can access the global class anywhere irrespective of the namespace. If you declare a method or variable as global, you must also declare the class that contains it as global.

Public class is accessible within namespace only.

Protected means that the method or variable is visible to any inner classes in the defining Apex class, and to the classes that extend the defining Apex class. You can only use this access modifier for instance methods and member variables.

Check the below link for more information.
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_access_modifiers.htm

14. What is the benefit of using Custom Label in Salesforce?
Custom Labels can be fetched in any language supported by the Salesforce platform. This gives flexibility to the developer to create a multilingual application which will automatically get translated to the user’s native language.
We can use it for configuring values to avoid SOQL.

15. LockerService For Lightning Components
At a high level, LockerService uses various technologies and techniques that are intended to do the following:

Prevent:

Components from causing XSS and similar security issues
Components from reading other component’s rendered data without any restrictions
Components from calling undocumented/private APIs

Enable:

Cool new features like client-side API versioning similar to REST API versioning*
Faster security review
Better and more secure JS development practices
Running 3rd party JS frameworks like React, Angular and so on*
Easily adding or removing new security features and policies

Check the below link for more information

https://developer.salesforce.com/blogs/developer-relations/2016/04/introducing-lockerservice-lightning-components.html

16. Difference between Governor limit and Heap limit in Salesforce
Governor Limit
If some Apex code ever exceeds a limit, the associated governor issues a run time exception that cannot be handled.

Apex run time engine strictly enforces a number of limits to ensure that runaway Apex does not monopolize shared resources.

Heap limit
The allocation of memory storage for use in a computer program during the runtime of that program.
When you create objects in your Apex code, memory is allocated to store these objects.

17. What is the difference between LastModifiedDate and SystemModStamp?
Let’s recap what LastModifiedDate and SystemModStamp dates are. They are both system fields that store date and time values for each record.

LastModifiedDate is automatically updated whenever a user creates or updates the record. LastModifiedDate can be imported with any back-dated value if your business requires preserving original timestamps when migrating data into Salesforce.

SystemModStamp is strictly read-only. Not only is it updated when a user updates the record, but also when automated system processes update the record. Because of this behavior, it creates a difference in stored value where ‘LastModifiedDate <= SystemModStamp’ but never ‘LastModifiedDate > SystemModStamp’.

So, how does this affect the performance of a SOQL query? Under the hood, the SystemModStamp is indexed, but LastModifiedDate is not.

LastModifiedDate and SystemModstamp will differ when automated processes update the records, which will happen in the following scenarios (asynchronously in some cases):

a) The archive date is extended to greater than 365 days.
b) An existing picklist value is updated (not replaced with an existing picklist value).
c) A contact's e-mail address is flagged as per the Email Bounce Management configuration.
d) The LastActivityDate field is modified
e) Roll-up summary field is created, which will update all the parent records' SystemModstamp asynchronously. Recalculation will also take place if the Summary Type is updated.
f) Some Salesforce Internal backend processes also update SystemModstamp as SystemModstamp is used internally to signal that a record (or related data) may have changed and that internal processes may need to synchronize themselves to the new record data.

18. What is the difference between External lookup relationship and Indirect lookup relationship
External lookup relationship

External lookup relationship links a child standard, custom, or external object to a parent external object. The values of the standard External ID field on the parent external object are matched against the values of the external lookup relationship field. For a child external object, the values of the external lookup relationship field come from the specified External Column Name.

In the External lookup relationship, External Object will be the parent.

Indirect lookup relationship

An indirect lookup relationship links a child's external object to a parent standard or custom object. You select a custom unique, external ID field on the parent object to match against the child’s indirect lookup relationship field, whose values are determined by the specified External Column Name.

In an Indirect lookup relationship, the Salesforce standard or custom object will be the parent and External Object will be the child.

November 6, 2019

Concurrent Apex Errors

If you receive the following error message, your organization may experience performance issues and possible service disruptions.

'Unable to process request. Concurrent requests limit exceeded.'

This system exception will be raised when your concurrent Apex requests exceed governor limitations for your Salesforce organization. These limits are determined by your current Salesforce edition.

If Synchronous Apex runs more than 5 sec it considered as long running job. And we have limit that only 10 long running job can execute at a time. So, whenever 11th Synchronous apex tries to execute, it gets Concurrent Apex limit error

Possible concurrent Apex error scenarios:

Poorly coded Apex
Synchronous callouts from Visualforce pages
Inefficient SOQL queries

Check the below link for tips to fix the Concurrent Apex

http://www.infallibletechie.com/2018/03/what-is-concurrent-request-limit-in.html

How to improve SOQL query performance in Salesforce?

SOQL queries must be selective, particularly for queries inside triggers for the best performance. To avoid long execution times, non-selective SOQL queries may be terminated by the system. Developers will receive an error message when a non-selective query in a trigger executes against an object that contains more than 200,000 records.

Query Plan in Salesforce
The new Query Plan tool in the Developer Console can help speed up SOQL queries done over large volumes. Use the Query Plan tool to optimize and speed up queries done over large volumes. Check the below link for more details

http://www.infallibletechie.com/2015/07/query-plan-in-salesforce.html

The following fields are indexed by default that makes SOQL selective:

1. Primary keys (Id, Name and Owner fields).
2. Foreign keys (Lookup or Master-Detail relationship fields).
3. Audit dates (such as SystemModStamp).
4. Custom fields marked as External ID or Unique.

You can contact Salesforce.com support to make a field indexed(custom index).

Even indexing can fail your SOQL. So, consider the threshold. For standard index, 30% for first 1 million and 15% after that. For custom index 10% for first 1 million and 5% after that.

Check the below link for Salesforce SOQL Cheat Sheet

http://resources.docs.salesforce.com/194/0/en-us/sfdc/pdf/salesforce_query_search_optimization_developer_cheatsheet.pdf

November 5, 2019

Set Checkpoints in Apex Code

Use Developer Console checkpoints to debug your Apex classes and triggers. You can’t set checkpoints in Visualforce markup.

Checkpoints persist until you click Debug --> Clear Checkpoint Locations.

Use checkpoints to investigate the objects in memory at a specific point of execution and see the other objects with references to them.

If you set a checkpoint in a method with the @future annotation, you must keep the Developer Console open until the @future method completes asynchronously.

1. Select the Lines for Check Points.


2. Execute the code from Anonymous Execute window with Open Log check box checked.


3. Go to Check Points tab to view the values at the run time.


How to avoid sending emails to specific emails from Salesforce?

1. Create a custom object to hold the exception emails.


2. Create records in the custom object.


3. Use the below code.

  1. trigger EmailMessageTrigger on EmailMessage ( before insert ) {  
  2.       
  3.     Set < Id > setEmailRecIds = new Set < Id >();  
  4.     Set < String > setEmailAddress = new Set < String >();  
  5.     Set < String > notAllowedEmails = new Set < String >();  
  6.     Map < Id, String > mapRecIdEmail = new Map < Id, String >();  
  7.       
  8.     for ( EmailMessage objMsg : trigger.new ) {  
  9.           
  10.         if ( String.isNotBlank( objMsg.ToAddress ) )  
  11.             setEmailAddress.addAll( objMsg.ToAddress.split( ';' ) );  
  12.         if ( objMsg.ToIds.size() > 0 )  
  13.             setEmailRecIds.addAll( objMsg.ToIds );  
  14.           
  15.     }  
  16.       
  17.     if ( setEmailRecIds.size() > 0 ) {  
  18.           
  19.         for ( Lead objLead : [ SELECT Id, Email FROM Lead WHERE Id IN: setEmailRecIds ] ) {  
  20.               
  21.             setEmailAddress.add( objLead.Email );  
  22.             mapRecIdEmail.put( objLead.Id, objLead.Email );  
  23.               
  24.         }  
  25.         for ( Contact objContact : [ SELECT Id, Email FROM Contact WHERE Id IN: setEmailRecIds ] ) {  
  26.               
  27.             setEmailAddress.add( objContact.Email );  
  28.             mapRecIdEmail.put( objContact.Id, objContact.Email );  
  29.               
  30.         }  
  31.         for ( User objUser : [ SELECT Id, Email FROM User WHERE Id IN: setEmailRecIds ] ) {  
  32.               
  33.             setEmailAddress.add( objUser.Email );  
  34.             mapRecIdEmail.put( objUser.Id, objUser.Email );  
  35.               
  36.         }  
  37.           
  38.     }  
  39.       
  40.     for ( Email_Exception__c objExcp : [ SELECT Email__c FROM Email_Exception__c WHERE Email__c IN: setEmailAddress ] )  
  41.         notAllowedEmails.add( objExcp.Email__c );  
  42.       
  43.     for ( EmailMessage objMsg : trigger.new ) {  
  44.           
  45.         if ( String.isNotBlank( objMsg.ToAddress ) ) {  
  46.               
  47.             for ( String emailAddr : objMsg.ToAddress.split( ';' ) ) {  
  48.                   
  49.                 if ( notAllowedEmails.contains( emailAddr ) )  
  50.                     objMsg.addError( 'You cannot send email to this email address ' + emailAddr );  
  51.                   
  52.             }  
  53.               
  54.         }  
  55.           
  56.         if ( objMsg.ToIds.size() > 0 ) {  
  57.               
  58.             for ( Id recId : objMsg.ToIds ){  
  59.                   
  60.                 if ( mapRecIdEmail.containsKey( recId ) ) {  
  61.                   
  62.                     if ( notAllowedEmails.contains( mapRecIdEmail.get( recId ) ) )  
  63.                         objMsg.addError( 'You cannot send email to this email address ' + mapRecIdEmail.get( recId ) );  
  64.                       
  65.                 }  
  66.                   
  67.             }  
  68.         }  
  69.     }  
  70.   
  71. }  

Output:



November 4, 2019

How to Schedule Flow in Salesforce?

1. Go to Flows in Setup.

2. Click New.

3. Select Autolaunched Flow.

4. Double click the Start component to schedule it.


How to deploy Custom Metadata type records using Change Set in Salesforce?

1. Select the Custom Metadata Type from the Component Type. If your custom metadata type label is Sample. You will be able to select Sample from the Component Type.


2. Select the Metadata Type records and click Add to Change Set button.

November 3, 2019

Salesforce Interview Questions with Answers Part 56

1. Assets best practices in Salesforce

Assets allow you to track specific information about the products and services purchased or installed by customer accounts or contacts Use assets to track everything you need to know about a customers existing products.

While products represent the items that your company sells, assets represent the specific products your customers have purchased. Use assets to store information about your customers' products.

Best practice in using Assets in Salesforce

1. Assets should be created when Opportunity is closed won. Products used in the opportunity should be used for creating it. Account from Opportunity and Product related to Opportunity should be populated on the Asset. Opportunity Line Item can be used for Product code, Quantity, and Price.
2. Asset should be linked to the Opportunity's Account.
3. Use the Competitor Asset check box to track Competitor assets.
4. Work Order creation and Parts Requests can start from Asset in Salesforce for tracking.
5. Asset Replacements
When a customer’s asset needs to be replaced or upgraded, track the replacement in Salesforce on asset detail pages.
a. The Primary Assets related list shows assets that replaced the current asset.
b. The Related Assets related list shows assets that the current asset replaced.
6. You can create asset hierarchies to represent products with multiple components, and view a tree grid of an asset’s hierarchy on its detail page. On the support side, assets can be linked to cases, work orders, maintenance plans, entitlements, and contract line items, making it easy to see an asset’s history from production to retirement.

2. What counts towards API usage in Salesforce?

Any action that sends a call to the API counts toward usage limits, except the following

1. Outbound messages
2. Apex callouts

3. Considerations for Email Open Tracking

In Lightning Experience, email tracking applies to all emails and list emails sent through Salesforce, Office 365, Gmail, Email Relay, and Einstein Activity Capture.

Email tracking doesn’t apply to emails sent from Cases or emails that use Email-to-Case.

List emails show tracking information in the HTML Status Report only.

If the recipient field has an email address only, and no related contact, lead, or person account, it isn’t tracked.

If the body of an email is blank, it isn’t tracked.

If email tracking was enabled before, emails sent before Winter ‘19 don’t show the correct tracking information in Lightning Experience. The activity timeline and the email record home show Not Tracked for these emails. The correct tracking information is available in the HTML Status report.

4. What if the evaluation criteria is set to "Only when a record is created" in time-based Workflow?

In this case, the Workflow rule evaluates the time triggers only once. If the record that fired the rule changes and no longer meets the evaluation criteria, the pending actions are removed from the queue and the rule is never reapplied to the record.

All pending actions are evaluated only for as long as the rule criteria is true. While Salesforce evaluates the rule every time the record is updated, it does not trigger all the actions associated with the rule every time.

Example: Consider two rules that are identical, except the evaluation criteria of Rule 1 is "On create only" and Rule 2 is "When a record is created, and anytime it's edited to subsequently meet criteria."
If you create a record that matches both rules, Salesforce executes the immediate actions and queues the time-dependent actions of both rules. If you then update the record and it no longer meets the rule criteria, Salesforce removes the pending actions for both rules. If you then update the record so it meets the rule criteria again, Salesforce only executes the actions associated with Rule 2.

5. Enable Email Tracking for All Customers Opening Email from Your Company

Let sales reps see if and when customers open email sent through Salesforce. In Lightning Experience, reps see tracking info right in the activity timeline, and—if they aren’t using Einstein Activity Capture—in the HTML Email Status report. Salesforce Classic users see the indicators in a report or in a related list. This feature applies to all emails sent through Salesforce; it can’t be turned off for individual emails or customers.

Lightning Experience organizations must enable Enhanced Email.

From Setup, enter Activity Settings in the Quick Find box, then select Activity Settings.
Select Enable Email Tracking.
Click Submit.

6. Salesforce Change Data Capture notifications

1. If the record is updated without any field values changes, it sends notifications with LastModifiedDate.
2. If multiple records are updated on the same transaction without any field values changes, it sends one notification with recordIds attribute holding multiple ids.
3. If multiple records are updated on the same transaction with the same field values changed, it sends one notification with recordIds attribute holding multiple ids with field and its value.
3. If multiple records are updated on the same transaction with different field values changed, it sends multiple notifications with recordIds holding one Id and it's related field and its value.

7. Patch Releases and Daily Releases in Salesforce

Patch Releases and Daily Releases are used to deliver scheduled and ad hoc application fixes and are typically seamless to customers. Whenever possible, patches and daily releases are deployed during off-peak hours and without downtime. Patch releases are scheduled weekly and are usually deployed to instances on Tuesday, Wednesday or Thursday, with releases to Asia-Pacific instances the following day. Daily releases are conducted on an as-needed basis and can occur any day of the week.

For more information check the below link

https://help.salesforce.com/articleView?id=000176208&type=1

8. How to create EmailMessage manually and link it to a record?

1. Create EmailMessage.
2. Create EmailMessageRelation to link it to the record using relationId field.

// if EnhancedEmail Perm is not enabled, continue logging the email as a task

// if EnhancedEmail Perm is enabled, create an EmailMessage object
EmailMessage emailMessage = new EmailMessage();
emailMessage.status = '3'; // email was sent
emailMessage.relatedToId = '006B0000003weZGIAY'; // related to record e.g. an opportunity
emailMessage.fromAddress = 'sender@example.com'; // from address
emailMessage.fromName = 'Dan Perkins'; // from name
emailMessage.subject = 'This is the Subject!'; // email subject
emailMessage.htmlBody = '<html><body><b>Hello</b></body></html>'; // email body
// Contact, Lead or User Ids of recipients
String[] toIds = new String[]{'003B000000AxcEjIAJ'};
emailMessage.toIds = toIds;
// additional recipients who don’t have a corresponding contact, lead or user id in the Salesforce org (optional)
emailMessage.toAddress = 'emailnotinsalesforce@toexample.com, anotherone@toexample.com';
insert emailMessage; // insert

// Add Email Message Relation for id of the sender
EmailMessageRelation emr = new EmailMessageRelation();
emr.emailMessageId = emailMessage.id;
emr.relationId = '005B0000003qHvOIAU'; // user id of the sender
emr.relationType = 'FromAddress';
insert emr;

9. TIMEVALUE formula in Salesforce

TIMEVALUE function returns the time in GMT.

When the user select Date/Time field in Salesforce, they select it in their timezone. But, Salesforce saves that in GMT.

10. TLS 

Transport Layer Security (TLS), and its now-deprecated predecessor, Secure Sockets Layer (SSL),[1] are cryptographic protocols designed to provide communications security over a computer network.[2] Several versions of the protocols find widespread use in applications such as web browsing, email, instant messaging, and voice over IP (VoIP). Websites can use TLS to secure all communications between their servers and web browsers.

11. Function ISCHANGED 

ISCHANGED  function is available only in:

1. Assignment rules
2. Validation rules
3. Field updates
4. Workflow rules if the evaluation criteria are set to Evaluate the rule when a record is: created, and every time it’s edited.
5. Formula criteria for executing actions in Process Builder.
6. This function returns FALSE when evaluating any field on a newly created record.
7. If a text field was previously blank, this function returns TRUE when it contains any value.
8. For number, percent, or currency fields, this function returns TRUE when:
a. The field was blank and now contains any value
b. The field was zero and now is blank
c. The field was zero and now contains any other value

12. How to override New button in Salesforce Lightning Experience?

Use lightning:actionOverride in the aura:component to override standard actions in Salesforce Lightning Experience.

Sample Code -  https://www.infallibletechie.com/2019/05/how-to-override-new-button-in.html

13. Manage Sharing permission on the profile in Salesforce

It allows the user to manage sharing configurations, including Organization-wide defaults.

14. What happens when a parent object permission is set to private and child object permission is set to public read-only or public read/write?

Users with Read access on Child objects can view all child records even though they don't have access to the parent records. They can also view to which parent record it is related to.
Users with Edit access on Child objects can edit all child records.
Users can view parent records if they are the owner or they get sharing through role hierarchy, manual sharing, etc.

15. Phone No and Email fields in Task and Event objects in Salesforce

Phone No and Email fields in Task and Event objects in Salesforce are not editable and are auto-populated from the associated contact or lead record.
These are special fields as they pull the information of Phone and Email from either Contact or Lead.
It contains the phone number of the contact or lead related to the task. This field is filled in with the value from the related contact or lead record.

16. Login Flows

Manage your login flows. Use login flows to introduce business processes during login, such as to prompt for two-factor identification, accept terms of service, or collect information about the user. After users complete the login flow, they're logged in. This page lists available login flows and the user profile associated with each.

17. Sample Builder Pattern in Salesforce

The Builder is a design pattern designed to provide a flexible solution to various object creation problems in object-oriented programming. The intent of the Builder design pattern is to separate the construction of a complex object from its representation.

For more information and a useful example on the Builder Pattern see http://developer.force.com/cookbook/recipe/email-utility-class

18. How to test scheduled actions from the Process builder using Test class?

Test.stopTest() executes scheduled actions for record-change processes and event processes (built-in Process Builder) and resumes flow that is waiting for time-based resume events.

19. How to ensure Field Level Security in SOQL in Salesforce?

Use the WITH SECURITY_ENFORCED clause to enable field and object-level security permissions checking for SOQL SELECT queries in Apex code, including subqueries and cross-object relationships.

If any fields or objects referenced in the SOQL SELECT query using WITH SECURITY_ENFORCED are inaccessible to the user, an exception is thrown, and no data is returned.

Example
If field access for either LastName or Description is hidden, this query throws an exception indicating insufficient permissions.
view source print?

List<Account> act1 = [SELECT Id, (SELECT LastName FROM Contacts),
   (SELECT Description FROM Opportunities)
   FROM Account WITH SECURITY_ENFORCED]

The WITH SECURITY_ENFORCED clause is only available in Apex. Using WITH SECURITY_ENFORCED in Apex classes or triggers with an API version earlier than 45.0 is not recommended.

20. How to add value to a specific array or list index using apex in Salesforce?

List < String > strList = new List < String >();
strList.add( 'Test 0' );
strList.add( 'Test 1' );
strList.add( 'Test 2' );
system.debug( 'Value in 1st block is ' + strList.get( 1 ) );//Test 1
strList.add( 1, 'Sample 1' );
system.debug( 'Value in 1st block is ' + strList.get( 1 ) );//Sample 1

21. Salesforce Extensions for Visual Studio (VS) Code

Salesforce Extensions for VS Code is built on top of Salesforce CLI and VS Code. Together, they are an integrated development environment that’s created for custom development on Lightning Platform. Best of all, you can run Salesforce CLI commands directly from the command palette or terminal.

22. controller attribute in aura:component tag

The server-side controller class for the component in the format namespace.myController or myController if using the default namespace.
We can refer only one apex class.

Referencing multiple Server-Side Apex controllers Classes within a Lightning Component is not supported.

23. Related To field is not editable in Salesforce

Related To indicates the record that the task is related to, such as an account or an opportunity. This field is available only when a user relates the task to a contact, not to a lead. The record is visible only to users with the “Read” permission for the type of record the task is related to.

You can’t relate an account, opportunity, or other objects to a task already related to a lead.

If a user relates the task to an object other than an account, Salesforce determines the account on the task as follows.

Suppose that a user relates the task to an opportunity, a contract, or a custom entity that belongs to an account. Salesforce uses that object’s account as the account for the task.
Suppose that a user relates the task to some other object and also to contact. Salesforce uses the primary contact’s account as the account for the task.
If a user leaves the Related To field empty, Salesforce doesn’t relate an account to the task.

24. 'Callout from triggers are currently not supported' error in Salesforce

In certain scenarios, we need to make the callout from the trigger to call an external web service however we are not able to do so as it gives the below-mentioned error "Callout from triggers is currently not supported".

An Apex trigger can execute a callout when the callout is invoked within a method defined as asynchronous: that is, defined with the @future keyword. The @future annotation signifies that the Apex method executes asynchronously.

Callouts must be made asynchronously from a trigger so that the trigger process isn’t blocked while waiting for the external service's response. The asynchronous callout is made in a background process, and the response is received when the external service returns it. To make an asynchronous callout, use asynchronous Apex such as a future method.

The best practice is to call future callout method on after insert and after update events.

25. SOQL with parent field reference

Always use Parent Id instead of Parent.Id.
Example:
Use AccountId instead of Account.Id in the Query.

Use inner join query instead of using Parent object field reference. Make sure the parent object field is indexed for selective.
Example:
List < Contact > listContacts = [ SELECT Id FROM Contact WHERE Account.Name = 'Test' ];//Takes more time to execute
List < Contact > listContacts1 = [ SELECT Id FROM Contact WHERE AccountId IN ( SELECT Id FROM Account WHERE Name = 'Test') ];//Takes less time to execute

26. Chatter Usage impact on Data Storage in Salesforce 

Chatter feed posts and comments are not counted against your data storage limits.

File storage includes files in attachments, Files home, Salesforce CRM Content, Chatter files (including user photos), the Documents tab, the custom File field on Knowledge articles, and Site.com assets.

Reference Link

https://help.salesforce.com/articleView?id=overview_storage.htm&type=5

27. 'Top Results' in Salesforce Lightning Experience Global Search

In Lightning Experience, each user's Top Results page includes the objects they use the most.
For new users or users that have little to no activity in Salesforce for over 90 days:

- Default global search in Classic returns all objects (same results as clicking 'Search All').

- Default 'Top Results' in Lightning returns the objects that are set in the current Lightning App's navigation menu

28. Trigger.size in Salesforce trigger

The total number of records in a trigger invocation, both old and new.

29. How to deploy Field Set using Apache ANT tool in Salesforce?

<types>
        <members>ObjectAPIName.FieldSetAPIName</members>
        <name>FieldSet</name>
</types>


30. Formula Field and Parent record value in the trigger

In trigger context, you can reach only fields from the processed object level. This means no relation fields are available. Although you can get those values in 3 ways - either use SOQL query, formula field or workflow.

31. How to join a list of strings with a separator using Apex in Salesforce?

List < String > strList = new List < String > { 'Test 1', 'Test 2', 'Test 3' };
String str = String.join( strList, ', ' );
system.debug( 'Joined with coma is ' + str );//Test 1, Test 2, Test 3

32. Running user of Platform Events subscribers in Salesforce

Unlike triggers on standard or custom objects, triggers on platform events don’t execute in the same Apex transaction as the one that published the event. The trigger runs in its own process under the Automated Process entity, which is a system user.

33. 'Reload' button under Bulk Data Load Jobs in Salesforce

The reload button refreshes the page of the under bulk data load jobs on its current state which is the status of the import. It does not redo the import and has the sole purpose of refreshing the page.

34. Security and the PushTopic Query

Subscribers receive notifications about records that were created, updated, deleted, or undeleted if they have:
Field-level security access to the fields specified in the WHERE clause
Read access on the object in the query
Read access on the PushTopic
Visibility of the new or modified record based on sharing rules
If the subscriber doesn’t have access to specific fields referenced in the query SELECT clause, then those fields aren’t included in the notification. If the subscriber doesn’t have access to all fields referenced in the query WHERE clause, then they will not receive the notification.

For example, assume a user tries to subscribe to a PushTopic with the following Query value:

SELECT Id, Name, SSN__c
  FROM Employee__c
 WHERE Bonus_Received__c = true AND Bonus_Amount__c > 20000
If the subscriber doesn't have access to Bonus_Received__c or Bonus_Amount__c, the subscription fails. If the subscriber doesn’t have access to SSN__c, then it won’t be returned in the notification.

If the subscriber has already successfully subscribed to the PushTopic, but the field-level security then changes so that the user no longer has access to one of the fields referenced in the WHERE clause, no streamed notifications are sent.