Make Lightning Record Page Look Like Classic Record Page

 

If you love how the record page is displayed in Classic, then what I am going to share in this post, you will definitely like that.

If you like videos, then I have created a small video as well to explain the steps. You can check the video here.

In Classic, when you open any record detail page, you will find all the related list and Open Activities, Activity History, Notes & Attachments as you scroll down, but when you open the same record page in Lightning, you will find a tab named “Related” and under which you will find all the related lists. In Lightning, activities, and chatter can be found on the right side of the record page. Below two screenshots show how the same record page displays in Classic and Lightning Experience.

Classic

Lightning Experience

How to make Lightning Record Page Look Like Classic Record Page

Step 1

Go to Setup and search for “Record Page Settings”. Then, open the “Record Page Settings”.

Step 2

Select “Full View” under “Default Lightning Experience Record Page View“.
Select “Related Lists” under “Default Activities View (desktop only)“.
Here are the screenshots –

Final Look

As you can see above, we have scrolled view in Lightning instead of the tabbed view. 

Video

Here is the video –

Fetch All Fields In SOQL Query | Spring 21 New Feature

Fetch All Fields In SOQL Query | Spring 21 New Feature

Sudipta Deb

Sudipta Deb

Founder of Technical Potpourri, Co-Founder of Shrey Tech, Enterprise Cloud Architect

If you worked with SQL or any other query language before, you probably familiar with Select * from …, right? This is the way to fetch all fields from a particular table in other(mostly all) query languages. But in the Salesforce world, we were not having this feature. In SOQL, there is nothing with which we can fetch all the fields unless we specifically mention all the field names in the query.

But now in Spring 21, Salesforce is bringing a function through which we can fetch all fields in SOQL Query.

We have now FIELDS(ALL), FIELDS(STANDARD), and FIELDS(CUSTOM) which we can use in the SOQL query.

 

  • FIELDS(ALL) – This fetches all the fields of an object. This is similar like Select * from SQL.
  • FIELDS(STANDARD) – This fetches all standard fields of an object.
  • FIELDS(CUSTOM) – This fetches all custom fields of an object.
Here is how the query will look like –
List<Contact> allConatcts = [SELECT FIELDS(ALL) FROM CONTACT LIMIT 200];

In Subqueries, it will look like –

List<Account> allAccounts = [SELECT Account.Name, (SELECT FIELDS(ALL) FROM Account.Contacts LIMIT 200) FROM Account];

The form you have selected does not exist.

Bounded And Unbounded Queries

When API cannot determine the set of fields in advance, then it will consider query as Unbounded Query, other if API can determine the set of fields in advance, then it is Bounded Query. For example – The number of custom fields for an object is not pre-determined, so FIELDS(CUSTOM) and FIELDS(ALL) are considered as Unbounded Query. The below table is a good reference to understand how these functions will work w.r.t bounded and unbounded queries.

Limitation

With great power, comes responsibilities. In Multi-tenant architecture, it is very much important to make sure running queries for one org will not have any impact on that org as well as other orgs present in the same server/node. As a result,
  • Fetching more than 200 records per query is not allowed.

Best Practice

If field names can be determined during runtime (through describe or metadata or custom settings etc.), then adding the field names in the query will give you better performance than using the function FIELDS function. The below post will help you to understand how you can build your queries dynamically.

Disclaimer

This article is not endorsed by Salesforce, Google, or any other company in any way. I shared my knowledge on this topic in this blog post. Please always refer to Official Documentation for the latest information.

Comments

How to use images as Static Resource in Salesforce Flow

How to use images as Static Resource in Salesforce Flow

Sudipta Deb

Sudipta Deb

Founder of Technical Potpourri, Co-Founder of Shrey Tech, Enterprise Cloud Architect

This blog post will cover – “How to use images in Salesforce Flow?” 

I will be implementing two use cases where in the first use case, it will be just displaying the image, wherein the second use case, it will be displaying the image along with logged-in user name in the same line.

Use Case I

Requirement: Need to display “Welcome” image without any text in the first screen of the flow.
 
Implementation:

Step 1

The form you have selected does not exist.

Upload the image as a static resource.

Step 2

Create a screen flow and include the Display Image flow component. Image Name will be the name of the Static Resource name,  Horizontal Alignment will be either left, center, or right. You can include CSS styling, Image Height, and Image Width.

Final Screen:

Use Case II

Requirement: Need to display “Welcome” image with logged-in user name in the first screen of the flow.
Implementation:

Step 1

We will use the same image from the previous use case.

Step 2

Create a screen flow and inside the flow first, let’s create a constant of type text as shown below –

In the value section, replace Welcome with the name of your static resource.

Step 3

In the flow screen, use the Display Text flow component and use the constant and flow variable as shown below –

Final Screen:

I hope this will help you to use images as Static Resources in Salesforce Flow. 

Disclaimer

This article is not endorsed by Salesforce, Google, or any other company in any way. I shared my knowledge on this topic in this blog post. Please always refer to Official Documentation for the latest information.

Comments

Top Admin Features from Spring 21

 

Going through the entire release note is difficult and time-consuming. So in this post, I tried to share some of my most favorite admin features from the Salesforce Spring 21 release.

In my earlier post, I have shared Top Apex Features from Spring 21 release. You can check the post here.

Also if you prefer more video content, please check out my Youtube Playlist covering Salesforce releases here.

Feature 1 – Share Records with Manual Sharing

With this new feature, now we can share records and manage record shares in a new streamlined interface. Before this one, we need to go to Salesforce Classic to share records with specific users or user groups. Manual share is available only for accounts, contacts, opportunities, cases, leads and custom objects.

Feature 2 – No more support for Internet Explorer 11 in Lightning Experience

Starting Spring 21, Salesforce will no longer support Internet Explorer 11. Users can still use IE11, but they will be presented with a message stating that they are using unsupported browser. Any new features from Salesforce will be supported and available only on modern browsers.

Feature 3 – Can create more roles

Any Salesforce org created in Spring 21 and later, we can now create up to 5000 roles. In the existing org, the maximum number of roles allowed is 500, but in order to increase the limit, we need to contact Salesforce support.

Feature 4 – Opportunity Product

Sales rep is now having the flexibility to track multiple information on opportunity product records. For example, Sales rep can now track two accounts where the product should be delivered. With Spring 21 release, we can now create relationship and add them in the page layouts.
In the below example. I am creating a lookup relationship between Account and Opportunity Product (OpportunityLineItem). After creating the lookup relationship, we need to add the field in the related list in the page layouts.

 

Feature 5 – Analyze Performance For Lightning Pages

Performance Analysis in App Builder now assesses record page performance for the phone form factor. New tabs in the Page Analysis window will give separate results for a lightning record page both from desktop and mobile context.

Feature 6 – More Supports for Dynamic Actions

Now we can assign actions in the Lightning App Builder instead of the page layouts. Also, we can apply filters to control when and where the actions will appear for users.
To use Dynamic Actions, we need to first add the Highlight Panel to the record page and then click on Upgrade Now to complete the migration. After that all the migrated actions will appear. Click one of the existing ones [1] and then click on Add Filter [2] to control when and where the actions will appear for users or click on Add Action [3] to add a new action.

Feature 7 – Permission Removed for Guest Users

Starting Spring 21, Salesforce is removing View All, Modify All, Edit, and Delete object permissions on all objects for guest users in new and existing orgs. Basically, now guest users will have only read and create object permissions.

Feature 8 – Track Accounts as Campaign Members (Beta)

Now we can add account records as campaign members. We need to first turn on the Accounts as Campaign Members settings in Salesforce setup. After that, add the Campaign History and Campaigns related lists to the Account page layouts.

Feature 9 – Release notes are now in Salesforce Help

Salesforce Release Notes are now moved to Salesforce Help. So now Salesforce Help is going to be the one-stop-shop for all help, technical contents along with Salesforce Release notes. I personally love this one as I no need to keep track of another site. 

Feature 10 – Localized Component Labels and Attribute Values on Lightning Pages Using Custom Labels

We can now use custom labels in the Lightning App Builder and with that, we can support localization in our apps. In the below example, I have used custom label and used the translated text for the language German. Now in the Lightning App Builder, I have used the custom label instead of some hardcoded name. 

Finally – Salesforce release calendar

You can get full details from here. 

How to Convert Leads to a Person and Business Account at the Same Time | Spring 21 New Feature

 

If in your Salesforce Implementation, you are dealing with both individual and group accounts, then with the release of Spring 21, now you can link your converted leads into both individual and group accounts with the new LeadConvert Methods.

Note 

This feature is only available in Enterprise, Performance, and Unlimted Editions.

Video

If you prefer video, here is the youtube video 

Methods

The new LeadConvert methods will allow you to link converted leads into a business and person account instead of a contact. Below are the methods available –
  • getRelatedPersonAccountId() – Gets the Id of an existing person account to convert the lead into.
  • setRelatedPersonAccountId(String personAccountId) – Sets the Id of an existing person accoung to convert the lead into.
  • getRelatedPersonAccountRecord() – Gets the entity record of a new person account to convert the lead into.
  • setRelatedPersonAccountRecord(Entity relatedPersonAccountRecord) – Sets the entity record of a new person account to convert the lead into.
LeadConvertResult class holds the result of the lead conversion.

Example 1

The below example uses the existing personAccountId to convert the lead into. After the execution of this method, lead with id leadId will be converted into both business account with id businessAccountId and person account with id personAccountId.

public static void convertLeadWithExistingPersonAccount(String leadId,
    String businessAccountId, String personAccountId, String opportunityId) {
Database.LeadConvert lc = new Database.LeadConvert();
lc.setLeadId(leadId);
lc.setAccountId(businessAccountId);
//New Method to use the existing person account id to convert the lead into.
lc.setRelatedPersonAccountId(personAccountId);
lc.setOpportunityId(opportunityId);
lc.setSendNotificationEmail(false);

LeadStatus convertStatus = [SELECT
                                        Id,
                                        MasterLabel
                                   FROM LeadStatus
                                    WHERE IsConverted=true
                                    LIMIT 1];
lc.setConvertedStatus(convertStatus.MasterLabel);

Database.LeadConvertResult lcr = Database.convertLead(lc);
}

Example 2

The below example created a new person account to convert the lead into. After the execution of this method, lead with id leadId will be converted into both business account with id businessAccountId and a new person account will be created, which will then be used to convert the lead into.

public static void convertLeadWithNewPersonAccount(String leadId, String businessAccountId) {
Database.LeadConvert lc = new Database.LeadConvert();
lc.setLeadId(leadId);
lc.setAccountId(businessAccountId);
//New Method to create new person account and then use the id
        //to the convert the lead into.
Account pacc = [SELECT
                            Id,
                            lastname,
                            isPersonAccount
                        FROM Account
                        WHERE isPersonAccount=true
                        LIMIT 1];
pacc.lastname=‘PersonAccount Last Name’;
pacc.Id = null;
lc.setRelatedPersonAccountRecord(pacc);
lc.setSendNotificationEmail(false);

LeadStatus convertStatus = [SELECT
                                        Id,
                                        MasterLabel
                                   FROM LeadStatus
                                    WHERE IsConverted=true
                                    LIMIT 1];
        lc.setConvertedStatus(convertStatus.MasterLabel);

Database.LeadConvertResult lcr = Database.convertLead(lc);
}


Please let me know your feedback. Thanks.