Creating Dynamic Forms
My Scenario:
Opportunity
Two Record Types
A Page with
Details section
Highlights Panel
Dynamic Related List on main page
Activity and Chatter
4 Tabs
3 Related Record Components to display different sections of the current record
Rich Text Component
About 80 visible fields, so not too big.
Wishlist
Much more structured page layout.
Conditional sections for Record Types and Stages.
Conditional Tabs for Document Generation (more details to come).
Conditionally display key details at the top, depending on the Stage.
Steps
This is a HUGE job. Do not undertake this lightly, especially if you have more than two Page Layouts or more then two Record Types. You have to build all of the Record Type functionality you get out of the box with Page Layouts again from SCRATCH!
Summer '24 org
Do this in Sandbox
Install Clear Cache extension
Set it to remove Indexed DB, Everything, and reload the page (no other settings).
This will stop you being “gaslightninged”.
Every time you save the page, use the Clear Cache extension, and you won’t ever have to worry about if the field will appear on the page, it will!
Turn on Compact Layout
Turn on Dynamic Forms for Mobile
EVEN if you will never use Dynamic Forms on Mobile, just turn it on! It gives you conditional tabs.
Turn on Dynamic Actions for Mobile
Clone your Lightning Page, and make it available only one one App
Even create a new app just for this transition.
Mainly if this is the biggest object you use. If it’s just a tiny object, don’t worry about this new App step.
Deploying the new app and everything in it will be easier.
This will allow your users to slowly transition, and move back to the old app if needed at any time.
It will also allow you to build into the new app, some of the new features you haven’t used yet. I know there are at least 3!
If you have users that use Console Apps, then ensure that is an App you create new for using Dynamic Forms.
Ensure you App is available for Desktop and Mobile.
This is also a good opportunity to consolidate the number of Lightning pages you have down to as few as possible.
Have a good reason to have more than one.
This is ALSO a great time to start moving from Profiles to Permission Sets. At the very least:
Create a few main Permission Sets for Admin, and your key user groups, give them Edit Access to that Object.
Turn on “Field-Level Security for Permission Sets during Field Creation” in “User Management Settings”
Remember to Assign those new Permission Sets to the Users or go to the next Step and create a PSG for each main group. You can have a PSG and still have fields controlled by Profiles. Just any new Fields you create will be starting you on this path to Permission Sets.
ESPECIALLY create PSGs if you are using Custom Permissions also. So much easier to do up front.
Check your Page Layout you are going to convert from
Remove any buttons that you won’t use
Remove any blank sections
Remove any related lists not in use (eg Notes & Attachments, Notes)
You are NOT using Notes are you?
Convert your Page Layout
DO NOT use the Accordions option!
Now save and view your page, and start to get a feel for how different the page looks from standard.
Have the exact same record open in another app on another monitor, to compare.
Note the god-awful way the fields bunch up vertically in each column, and don’t align across the columns.
And notice all your blanks spaces have gone.
Edit the page:
in full page mode (clicking the edit icons),
in modal mode (clicking the edit button).
Test Creating New:
Are all the fields there needed
Create New of each Record Type
NOTE that there is no difference anymore, you now have to rebuild that whole functionality yourself
Test Creating new via Global Actions
Are they still what you need to create the basic record?
Test Cloning:
Remember Cloning STILL only works based on your old Page Layouts, so you may have to adjust them if you want to Clone.
And this may be annoying for users who want to go back to the “old” page layouts app.
I would suggest using a Flow to Clone and use the new Transform element, it works really well.
Remove the standard Clone button if you don’t have the right fields to Clone.
Immediately make the first round of fixes.
Set all Sections to have Horizontal Alignment.
Add back in your Blank Spaces. ALL OF THEM.
Save and view the page again. Sigh with relief.
Create “Helper Fields” for conditional visibility
Eg one for each Record Type. Given Record Types of Sales and Service, create IsSales and IsService. These will help you quickly set up conditional visibility.
Create Custom Permissions to help you hide buttons or sections from groups of people rather than using Profiles. Create Helper fields for Sales and Service users as IsSalesUser, IsServiceUser
Of course you don’t have to do this for obvious buttons like Delete, but there are so many other buttons that are just not useful for other users to see.
AND you lose Custom Links so you have to change all those to Buttons so you will want to make those Dynamic.
NOTE: if you are nearing your 500 or 800 field limit, then these helper fields may not be helpful.
Now, convert every Related Record Component that is for the “same object” into a Field Section.
You have to do this manually by dragging each field onto the page.
Remember to align fields horizontally and add blank spaces where you need to.
Add the same conditional visibility as was on the Related Record Component.
Remove the Related Record Component.
TIP: build your section at the top left hand side of the page to make it easy to drag the fields just a short way.
TIP: Filter the fields so you don’t have to scroll - eg do all Amount fields at once.
TIP: If you have two similar sections, build them at the same time, or Copy and Paste one section to another.
Now, rearrange your page - your narrow column is now useless, for anything exept maybe Related record field details that are not editable.
Even attempt different page arrangements.
Header and 3 regions is a bust
Header and 2 equal regions may be useful, but busy.
Don’t go too crazy, you don’t want this object to be way different looking than every other object, or do you? It is you that is going to have to go through all the change management and training and “who moved my cheese” with all your users.
The other page layouts (Pinned Header etc), now work with Dynamic Forms apparently, but they are only available if you create a brand new Lightning Page from scratch.
But they are still a bust due to narrow columns being useless for fields.
Get used to Cutting and Pasting rather than dragging sections. Dragging sections is a drag!
Now, ensure that each of the main sections that are visible for each Page Layout for each Record Type and / or Profile have been created and conditional visibility applied.
If you have not already set up Dynamic Actions now is the time to do that, ensuring the buttons required for each Record Type and or Profile are visible.
TIP: Use Custom Permissions and “Helper Fields” as noted above to help with hiding buttons.
If you have any Custom Links, I’m sorry. This is one of the highly annoying things.
Either, recreate them all as Buttons - I say recreate them because you still may want the Custom Links on the App that still has the old page layout for a time.
Unfortunately Reports don’t open in a new tab, at all, like Custom Links do. It is highly highly highly annoying.
And the Button overflow bar is going to get far too long.
Or, create them in a Flow - is that even possible? I don’t know.
Or, create them as a field as a Hyperlink Formula.
Or, create them as Report Charts - which unfortunately requires re-creating ALL the reports as well as creating the charts.
Or, create a Custom LWC that shows them - is that even possible - please, someone make that!
Or, wait another release or three. They say it is in the roadmap.
On the plus side, since you have to do soooo much work you are really going to consolidate and find out which Custom Links are in use.
Install and set up Salesforce Indicators!
Yes, now is the time to do it!
Now test everything again:
Clone
New
Edit
Console view
Mobile! (NOTE: I will NOT be focusing on Mobile on this run-through).
🛑 NOW STOP! 🛑
Do not try anything fancy.
No moving fields to other tabs.
No hiding sections that are only visible for certain stages.
No conditional tabs.
Give this to the users for at least 2 weeks, if not a month.
It’s up to you if you give them the option to go back to the old App / layout at this stage or only after you start messing with them more.
Let them get used to this bit of cheese being moved, before you unleash anything more.
Again, I’m only talking about your main objects here.
Use this time to refine all the other improvements (see below), and work on the next steps in your Sandbox.
You will also get used to the double maintenance you now have to do by having Dynamic Forms, and you will get used to the “gaslightning” that occurs every time you go to make a change.
Now trying the Fancy Stuff
Firstly, Clone your Lightning Page that you just finished with.
Start with the low hanging fruit
Sections that don’t need to be there on Closed Won
Go back to the old idea of a Closed Case Page Layout and only show things that are needed on Closed records.
Sections that don’t need to be there until a Stage is met.
Ensure they are still there at every later stage, (unless absolutely not necessary).
If you have sequential stages, then create a “helper formula” of IsProposal, that includes the stage of Working and Proposal, or IsNegotiation that contains Working, Proposal and Negotiation.
Or use Probability instead (if it 100% tracks with Stage).
Or create your own probability style field - Stage Number so you can stay Stage < 4 or Stage > 3. This may be useful where there are the same number of Stages between Record Types, but with different Names.
Now, remember you can have a field on the page multiple times. So you might have a field that belongs in a section that is only visible as Stage X, but you could display it in another section if it sometimes gets filled out earlier, and also include it in that Stage section. Especially if you are using Conditional Tabs.
Clean up that ugly System fields section.
This is the FIRST section to move onto Conditional Tabs.
Your users do not ever want to see the Opportunity Name? Sure, move it to another tab.
Name the Tab “Settings” or “Structure” or something useful
ENSURE YOU KEEP Created Date, Last Modified Date, Owner, Record Type.
Removing these breaks “Salesforce” (as in you may as well have any old Database in the cloud).
Create a Tab for each Document, or Integration. Conditionally display the Tab only when the user would click the button to send the Integration or build the Document.
Include every field on that page that is in the Document or sent over to Integration.
Often these are fields that are not visible on the page layout.
Include them in the order they are in the document. This is actually a good use of single column fields.
Make them editable still.
Include fields from other records using Related Records or Dynamic Lists
Unfortunately Opportunity Contact Roles are NOT available in Dynamic Lists
The user can then quickly scan down the fields to see what is missing on the document or in the integration, and edit it then and there before clicking the button.
For bonus points find a way to add the button to the Tab (see above).
Questions
Do Narrow Columns on pinned pages still show non compact layout?
Good Things
I can’t say when these good things happened since I haven’t looked for them in every single release because there was no way I was putting this much effort in without blank spaces and aligned field sections.
No more duelling Save Buttons! Yay!
So you CAN continue to use Related Record Components, AND they will NOT be editable at the same time as the main record page.
Just be careful using Related Record Components and Spanning Fields on the same page layout, unless it’s for a good reason.
You don’t have to refresh the page for new fields to be visible in Conditional fields. You do have to refresh for them to be visible in Fields though.
Issues
It is still so very slow to Save the page - about two to three seconds slower. And that is really noticeable.
No visible fields in both columns leaves the remaining fields to widen to one column. Just LEAVE COLUMNS ALONE! Unless I say One Column, then I want Two Columns.
Now I have to have a Blank Space, with the opposite conditions as the hidden fields
Spanning Fields - not being able to rename the fields.
Come up with a “Best Practice” of always putting the link to the record in that section.
No Field Preview on Page Editing.
It is NOT a technical limitation. LWCs can show field previews.
It is so hard to work with having that taken away, especially on very large pages.
Blank Spaces DO NOT CONVERT!
Come on! This is so half baked!
OMG you STILL Can’t have two columns in the Narrow Column like you can with Related Record Components? STILL? FIX THIS!
They STILL have not fixed that the narrow column does not show in Compact Mode! OMG!
Editing the Page
What is this? Why is it so goddamn un-useful?
Whilst we can now see which fields are required, we still can’t see which fields are on the page already, or where they are.
Look of the Page
It still LOOKS different to every other page.
Why can’t they just get the CSS of the height of the section headings and the font of the section headings consistent with standard pages, let alone the height of the fields, and the edit icons.
Checkboxes are still taller than other fields.
Why on earth do I have to set every single section to have the basic ability to align fields. When is anyone EVER going to NOT have them aligned!
Tips to prevent “Gaslightning”
Remove all buttons from the Page Layout other than those needed for Activities.
That will give you a hint when you go to add a new button to the Page Layout
Use ctrl+f to find the fields on the page.
Page Layouts are still required
To debug a Flow
Anywhere where code is required to look through the fields on a page layout
Formstack
Other Things to Fix whilst you’re at it
Paths!
Remove Fields from Paths, you don’t need them now, move them into a conditional section on the page.
Buttons on List Views:
Remove Printable View
Remove Pipeline Inspection
Remove Quip
Remove Import!
List Views:
Tidy them up
Ensure the fields are consistent
Ensure the filters make sense
Other Wishlist Items
Create Multiple Page Layouts at once, and have “Einstein” build in all the existing conditional visibility based on Profile and Record Type that exists in the multiple Page Layouts.
App Utility items on Mobile
At least some of them!
Add Comment