Comparing Leads with Accounts in Salesforce

1. Create a Account Matching Rule.

2. Create a Duplicate Rule using the account matching rule for Lead.


How/Where to find a list of PushTopics created in Salesforce?

Sample SOQL:

SELECT Id, Name, CreatedDate, CreatedBy.Name FROM PushTopic




Chatter email notifications not received by users that were mentioned in Salesforce

1. Check the email of the user. Sometimes, the user's email in sandbox after refresh will have incorrect email with "@example".


2. Check Email Deliverability.


3. Check this too - https://help.salesforce.com/articleView?id=000170906&type=1.

DKIM Keys in Salesforce

Salesforce uses DKIM keys to sign outbound emails that your organization sends from the Salesforce platform.

Use the DKIM (DomainKeys Identified Mail) key feature to let Salesforce sign outbound email sent on your company’s behalf. These signatures give recipients confidence that the email was handled in a way that’s consistent with your company.

To ensure your email message from Salesforce do not end up unread in the recipient’s spam folder,you can  easily implement DomainKeys Identified Mail (DKIM).Use the DKIM (DomainKeys Identified Mail) key feature to enable Salesforce to sign outbound emails sent on your organization’s behalf. A valid signature provides recipients confidence that the email was handled by a third party such as Salesforce in a way authorized by your organization.

Make sure you add the public key to your DNS record before you make your key active in Salesforce and start DKIM signing. DKIM signing is active whenever your DKIM key is in the active state.

To Create DKIK Keys, go to


What is a query locator in Salesforce?

A query locator represents a server-side cursor for a query. Typically a query locator is returned when not all the records requested in a query fit into the returned data set. This way a queryMore() can be issued with the provided query locator to get additional rows.

For example, consider a query API call where the batch size is set to 2,000 and the organization has 2000+ accounts. In this scenario, SELECT id FROM account will return 2,000 records and a query locator to retrieve the remaining records.

How to set Page Variation using Account information in Salesforce Community Cloud?

1. Create Audience based on Account information.


2. Create page Variation and assign the audience.


How to get DateTime in User Time Zone using Apex in Salesforce?

DateTime field values are stored as Coordinated Universal Time (UTC). When a dateTime value is returned in Salesforce, it’s adjusted for the time zone specified in your org preferences. SOQL queries, however, return dateTime field values as UTC values. If you want to process these values in different time zones, your application might need to handle the conversion.

Sample Code:


  1. Account acc = [ SELECT Id, CreatedDate FROM Account WHERE Id = '0015A000025NLtRQAW' ];  
  2. system.debug('Created Date is ' + acc.CreatedDate);  
  3. system.debug('Created Date is ' + acc.CreatedDate.format('YYYY-MM-dd hh:mm:ss'));  

Output:



How to Switch Between Your Salesforce Org and Communities in Lightning Experience?

In Lightning Experience, the App Launcher displays a tile for every published community along with your apps.

1. Click App Launcher.

2. Select the Community from the App Launcher.



LAST_N_DAYS in Salesforce

For the number n provided, starts 00:00:00 of the current day and continues for the past n days.

It includes today also.


Sample SOQL:

SELECT Id FROM Account WHERE CreatedDate = LAST_N_DAYS:365

Example - http://www.infallibletechie.com/2016/09/how-to-get-records-which-are-modified.html

Einstein Activity Capture in Salesforce

Einstein Activity Capture adds every email & event to Salesforce.

Einstein Activity Capture connects to Gmail or Office 365, automatically syncing all of your team’s customer communications to Salesforce. When reps send and receive emails and calendar events, Einstein ActivityCapture adds the messages to appropriate records in Salesforce – no manual data entry required. All of the captured messages are visible in Activity Timeline withinSalesforce, providing context for your entire team so they can help close the deal.


Check https://www.salesforce.com/content/dam/web/en_us/www/documents/datasheets/sales-cloud-einstein-activitycapture.pdf for more information.

To exclude users, check https://dreamevent.secure.force.com/articleView?id=aac_add_excluded_addresses_for_org.htm&type=0




Lightning Notifications using Apex

Sample Code:

  1. FeedItem post = new FeedItem();  
  2.   
  3. post.Body = 'Enter post text here';  
  4.   
  5. post.ParentId = '005U0000000gviFIAQ';//Id of the user record  
  6.   
  7.   
  8.   
  9. insert post;  

Output:


How to Relate a File to multiple records in Salesforce?

Sample Code:

  1. ContentDocumentLink objCDL = new ContentDocumentLink();  
  2. objCDL.ContentDocumentId = '0695A000004dRpRQAU';//Id of the file  
  3. objCDL.LinkedEntityId = '0035A00003MuvnuQAB';//Id of the record for sharing  
  4. objCDL.ShareType = 'V';  
  5. insert objCDL;  



All records that meet the filter criteria are ready to be updated when the next Screen or Wait element is executed or when the interview finishes Salesforce

When you face "All records that meet the filter criteria are ready to be updated when the next Screen or Wait element is executed or when the interview finishes", set up debug log to find the root cause of the issue.


If you look at the above debug log, it says Apex CPU Time limit exceeded.

List View Search in Salesforce

Use the new search bar to search the field data in your list views and find the records you need in record time.


Picklist values, lookup fields, derived fields, or formula fields are not searchable.

To find the fields that are searchable, check the below link

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

FIELD_INTEGRITY_EXCEPTION: An event can't last longer than 14 days Salesforce exception

FIELD_INTEGRITY_EXCEPTION: An event can't last longer than 14 days exception occurs when the difference between Start Date/Time and End Date/Time is greater than 14 days.


Sample Code:

  1. Event objEvent = new Event(Subject = 'Test', StartDateTime = System.now(), EndDateTime = system.now().addDays(15));  
  2.   
  3. insert objEvent;  


How to Set Two-Factor Authentication Login Requirements in Salesforce?

1. Download Salesforce Authenticator App in your phone.

2. In the profile or permission set, set Session Security Level Required at Login to High Assurance.


3. In the Session Settings, add Two Factor Authentication.


4. Try to login.

5. It will show the screen to enter the words from Salesforce Authenticator app.


6. Click Add Account in Salesforce Authenticator app to get the words.


7. Click Connect button to connect.

How to find how many dynamic dashboards are created in Salesforce?

Sample SOQL:

SELECT Id, DeveloperName, FolderName, CreatedBy.Name, LastModifiedBy.Name FROM Dashboard WHERE Type = 'LoggedInUser'

Output:


( OR )

1. Create a Custom Report Type using the Dashboards type.


2. Create a new report with the new Dashboards Report Type.

3. Select Show All Dashboards.

4. Select the All Time range.


5. Add the following filter: Dashboard Running User equals "Run as logged-in user, Let authorized users change running user".


Work Order Entitlement Processes in Salesforce

1. Go to the Entitlement Settings.


2. Check Enable Entitlement Management.


3. Create a Milestone in Salesforce.


4. Go to Entitlement Processes.


5. Click New Entitlement Processes.


5. Select Work Order as Entitlement Processes type.


6. Create a simple Entitlement Process with Milestone.


7. Define actions in Milestone.

8. Add Entitlement related fields and related list to the Work Order page layout.

9. Go to the Entitlements tab and create the Entitlement record.


10. Create a Work Order to see the Entitlement.


Locked Tab from Managed Package in Lightning Experience

If the Lightning app was installed from a managed package, you can append navigation items below the original set of navigation items included in the Lightning app, which are locked.

The locked icon (1) indicates that this set of tabs is fixed and can’t be changed.

Release Notes - https://releasenotes.docs.salesforce.com/en-us/winter18/release-notes/rn_general_lex_app_manager_append_tabs.htm


Simple Batch Job Status email in batch's finish method in Salesforce

Sample Code:

  1. global class SampleBatch Implements Database.Batchable <sObject> {  
  2.           
  3.     global Database.queryLocator start( Database.BatchableContext bc ) {  
  4.       
  5.         String SOQL = 'SELECT Id, Name FROM Account LIMIT 1';  
  6.         return Database.getQueryLocator(SOQL);  
  7.           
  8.     }  
  9.       
  10.     global void execute( Database.BatchableContext bc, List < sObject > scope ) {  
  11.           
  12.     }  
  13.       
  14.     global void finish( Database.BatchableContext bc ) {  
  15.           
  16.         AsyncApexJob a = [ SELECT Id, Status, NumberOfErrors, JobItemsProcessed, TotalJobItems, CreatedById  
  17.                              FROM AsyncApexJob  
  18.                             WHERE Id =: bc.getJobId() ];  
  19.         Messaging.SingleEmailMessage batchEmail = new Messaging.SingleEmailMessage();  
  20.         batchEmail.setTargetObjectId( a.CreatedById );  
  21.         batchEmail.setSubject( 'Batch ' + a.Status );  
  22.         batchEmail.setPlainTextBody( 'Jobs processed ' + a.JobItemsProcessed + ' with '+ a.NumberOfErrors + ' failures.' );  
  23.         batchEmail.setSaveAsActivity( false );  
  24.         Messaging.sendEmail( new Messaging.SingleEmailMessage[] {batchEmail} );  
  25.           
  26.     }  
  27.       
  28. }  

Output:


Anchor tag in Visualforce page

Sample code:


  1. <apex:page>  
  2.   
  3.     Link to Salesforce is below<br/><br/>  
  4.     <apex:outputLink value="https://www.salesforce.com" id="theLink">www.salesforce.com</apex:outputLink>  
  5.       
  6. </apex:page>  

Output:


View all call logs or report in Salesforce

1. Create a report with Tasks & Events.


2. Select Activity Type as Call in the filter.


How to Convert Attachments to Files in Salesforce?

Convert the attachments to files with the new Attachments to Files app from Salesforce Labs.

AppExchange Link - https://appexchange.salesforce.com/appxListingDetail?listingId=a0N3A00000EHAmyUAH


You can use the Attachments to Files tool to run bulk jobs that convert large numbers of attachments. Attachments are organized by the object they’re associated to. After the conversion, you can delete the attachments from the org to free up space.