Pages

Showing posts with label Dynamic. Show all posts
Showing posts with label Dynamic. Show all posts

Tuesday, May 9, 2023

Salesforce: Dynamic Forms controlling Field Type

One of the benefits of using the dynamic form is the ability to show and hide fields live based on 

  • Record field value selected or entered
  • User, e.g., profile, time zone, custom field, etc.
  • Parent record fields

But, not all field types can be used as a controlling field, as per the Summer '23 release, here is the list of field types that can be used: 

  • Auto Number
  • Checkbox
  • Currency
  • Email
  • Formula (Number) 
  • Formula (Text)
  • Number
  • Percent
  • Phone
  • Picklist
  • Text
  • URL

The following types are not supported as a controller field:
  • Date
  • Date/Time
  • Lookup
  • Picklist (Multi-Select)
  • Rich Text Area
  • Text Area

You also can set filter logic (AND, OR) if there are multiple filters.



Sunday, April 23, 2023

Salesforce: Dynamic form by Record Type

Background: Universal Container uses many record types in the Case object, one of the new requests is fit to use the dynamic form feature, but does not want to impact all existing record types which still use page layout.

Solution: create a new lightning record page (or clone from the existing one) and assign it to:

  •  A specific app
  • The new record type
  • All profiles that will use the new lightning record page 



Reference:


Sunday, August 28, 2022

Salesforce: Dynamic Forms (2)

After 18 months from my first dynamic form blog, we finally see a few standard objects covered by the dynamic form. As per the Winter '23 roadmap, we can enable Account (incl. person Account), Contact, and Opportunity with dynamic form.


Overall, the dynamic form functionality is still the same as per the initial release, where we can show/hide each field based on Record Field or Advanced, field with filters defined will have the eye orange icon next to it.



Record Field
  1. Field: another field in the same object
  2. Operator: depends on the selected Field (1) type, e.g. Contains, Equal, Not Equal
  3. Value: also depends on the selected Field (1) type
Advanced
  1. User, which is user info/detail
  2. Permissions, if the user has specific permission 
  3. Record, this can be a value from a related field, such as Created By Profile Name
Tips
you can't select more than 1 value in each filter, but you can add the same field in filters, then use "any filters are true" or filter logic.

Samples of use cases to use the dynamic form

  1. To hide/show fields from a specific profile in the layout, even the profile has visibility on the field-level security
  2. To hide/show fields from users without permission, such as View and Edit Converted Leads
  3. To hide/show field when the user selects a value, such as, when user Type = Customer, show Customer No, otherwise, hide Customer No field

But, do we still need the classic page layout when using the dynamic form? 

1. Record buttons are still determined by page layout, you can handle this by enabling dynamic action, check out here.

2. Related lists are also determined by page layout, you can handle this by removing the "Related Lists" component and adding the Related List - Single component for each related object. However, if you use the "Related List Quick Links" component (which is a great feature since Classic), adding "Related List - Single" will not add the object to "Related List Quick Links", so come and vote for this idea




Friday, February 26, 2021

Salesforce: Intro to Dynamic Forms

When Lightning introduced by Salesforce many years ago, it still depends on the "Classic" page layout. There has been a rumour for quite some time in the Salesforce community that we will be able to add fields directly in the Lightning app builder without the need for Classic page layout.

This finally comes true with Dynamic Forms. In the Winter '21 release, Dynamic Forms become Generally Available, but only for custom objects. As per, DreamTX 2020, the Dynamic Forms will be available in Summer '21 release, including for mobile support.


How to activate Dynamic Forms?

Dynamic Form needs to be enabled on each Lightning Record Page, so this means that you do not need to enable dynamic form for the whole org at once, you can enable it by the app, profile, or record type. So, you can pilot a profile with dynamic form, while all others still use Classic page layout within the same object.

Go to Object Manager, select the object, select Lightning Record Pages, to show all Lightning Record Pages that exist for that particular object, including other information such as Org Default, App Default, and Other Assignments.

There are two Lightning record pages for this object


Enabling Dynamic Forms

To enable dynamic forms, edit the lightning record page, this will open Lightning App Builder, select the Record Detail component, then click Upgrade Now button.


You will be presented with a wizard to follow to migrate the fields to the dynamic form. Optionally, you can select to enable migrating the fields and section into the Accordion component to improve the new page performance.


One-Way Ticket

Once a Lightning page is upgraded to Dynamic Form, you can't downgrade it back to Classic page layout. However, you can simply delete the Accordion or Field Section component, then adding back the "Record Detail" component which uses Classic page layout.




Monday, December 14, 2020

Salesforce: Dynamic Actions

Buttons on the Lightning page are set in the Classic page layout under the "Salesforce Mobile and Lightning Experience Actions" section.

Since Summer ’20 release, Salesforce introduce Dynamic Actions, with this, you can configure buttons on your record page directly within the Lightning App Builder, and will not depends on the (classic) page layout anymore.

Dynamic actions can be enabled for each Lightning Page, not the whole Lightning Page, so you can take time just to enable the ones needed.

From the Lightning App Builder, click Highlights Panel at the top, then click the "Upgrade Now" button.


Once enabled, you cannot disable it back, unless you create the new Lightning Page for that object, or delete and add a new Highlights Panel component.

After clicking "Upgrade Now", you will be presented with options to Migrate or Start from Scratch. 


Once this is done, any changes on the button in the "Salesforce Mobile and Lightning Experience Actions" page layout and compact layout will not impact to buttons on the Lightning page.


With Dynamic Actions enabled, you can set the action/button visibility based on criteria of the record fields, login user, or devices.



Reference: Learn MOAR: Try Dynamic Actions in App Builder with the Summer ’20 Release




Page-level ad