Overriding standard Salesforce UI actions

You can override the Salesforce standard UI for the following actions: Accept, Tab, Clone, Delete, Edit, List, New, and View for an object with your own programmatic UI pages, completely replacing the standard UI pages.

The following screenshot shows the action override options for the Edit action. As you can see, you have the flexibility to target different overrides depending on the experience the user is using; Salesforce Classic, Lightning Experience, or Salesforce Mobile:

Only the Edit, New, View, and Tab actions can be overridden, as shown in the preceding screenshot. All other actions can only be overridden with Visualforce pages and only apply in the Salesforce Classic user experience. Considering how significant the differences are between Salesforce Classic and Salesforce Lightning Experience, this is understandable. 

Be aware that if you take this option, you're taking on the responsibility of not only ensuring that you provide a way for new fields added to your application's objects to be added to the UIs you build, but also that new platform features of the standard UI appear in your page as Salesforce evolves the platform. So, make sure to review the standard UI page functionality before making the decision to package and override the applicable action, and also consider a hybrid approach, which is described in the next subsection.

If you decide to build a custom UI, the best way to keep inline is to use the Salesforce-provided standard UI components. In Visualforce, these are available in the apex namespace. In Lightning, you can leverage the components in the lightning namespace. In either case, you can style custom UI HTML elements with the Lightning Design System.

Using Salesforce-provided components is not, however, a 100% solution; for example, Chatter does not automatically appear on pages unless a developer enables it. Another significant consideration is that Custom Fields or related lists that subscribers have added to your objects need special consideration in your page code to ensure that they are surfaced through the use of the Field Sets and the standard Related List Lightning Component or apex:relatedList component in Visualforce, for example.

Finally, note that although the Action overrides can be packaged, they are nonupgradable, so changes will not apply to existing subscribers. Also, the subscriber can remove them post-installation if they prefer to access the Custom Object through the standard UI, so this is another reason to make sure that you consider the standard UI for all of your objects as a standard practice.

As an alternative to overriding an existing standard action, consider creating custom buttons, placing them on the object's Detail page and/or List View layouts, and naming the button something like Enhanced Edit or Enhanced New. Custom buttons are available in both Salesforce Classic and Lightning Experience standard UIs and allow you to invoke custom UIs built with Visualforce pages. If you are not interested in Salesforce Classic, you can invoke a Lightning Component from the standard UI in LEX by either embedding it in a Lightning Page, such as the Lightning Record Page layout (as shown in Chapter 6, Application Domain Layer), or utilizing Lightning Component Actions (discussed in Chapter 9, User Interfaces with Lightning Framework).

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.17.162.247