Reader small image

You're reading from  Salesforce Lightning Platform Enterprise Architecture - Third Edition

Product typeBook
Published inNov 2019
Reading LevelIntermediate
PublisherPackt
ISBN-139781789956719
Edition3rd Edition
Languages
Concepts
Right arrow
Author (1)
Andrew Fawcett
Andrew Fawcett
author image
Andrew Fawcett

Andrew Fawcett has over 30 years of experience holding several software development-related roles with a focus around enterprise-level product architecture. He is experienced in managing all aspects of the software development life cycle across various technology platforms, frameworks, industry design patterns, and methodologies. He is currently a VP, Product Management, and a Salesforce Certified Platform Developer II at Salesforce. He is responsible for several key platform features and emergent products for Salesforce. He is an avid blogger, open source contributor and project owner, and an experienced speaker. He loves watching movies, Formula 1 motor racing, and building Lego!
Read more about Andrew Fawcett

Right arrow

Leveraging Platform Features

In this chapter, we will explore some key features of the Lightning platform that not only enable developers to build an application more rapidly but also provide key features to the end users of the application. Using these features in a balanced way is the key to ensuring that you and your users not only get the best out of the platform today but continue to do so in the future as the platform evolves.

A key requirement for an enterprise application is the ability to customize and extend its functionality, as enterprise customers have varied and complex businesses. You should also keep in mind that, as your ecosystem grows, you should ensure that your partner relationships are empowered with the correct level of integration options and that partners need to interface their solutions with yours; the platform also plays a key role here.

As we...

Packaging and upgradable components

The amount of time taken to install your application and then get it configured for live use by your customers is a critical part of your customer relationship. They are obviously keen to get their hands on your new and improved releases as quickly as possible. Careful planning and awareness of the components you are using support packaging, and are upgradeable, are important, as these things impact the effort involved in going live with your application.

When exploring the various platform features available to you, it is important to check whether the related component types can be packaged or not. For a full list of components that can be packaged, you can use the Metadata Coverage report at https://developer.salesforce.com/docs/metadata-coverage.

If a component type relating to a feature you wish to use cannot be packaged, it does...

Understanding Custom Field features

Custom Fields carry many more features than you might think; they are much more than the simple field definitions you find on other platforms. Having a good understanding of a Custom Field is key to reducing the amount of code you write and improving the user experience and reporting of your application's data.

Default field values

Adding default values to your fields improves the usability of your application and can reduce the number of fields needed on the screen, as users can remove fields with acceptable defaults from the layouts.

Default values defined on Custom Fields apply in the native user interfaces and Visualforce UIs (providing the apex:inputField component is used), and...

Understanding the available security features

The platform provides security controls to manage the accessibility of functionalities in your application and also the visibility of the individual records it creates. As an application provider, your code has a responsibility to enforce security rules as well as provided integrations that help administrators configure security easily. This section is not aimed at taking a deep dive into the security features of the platform but is more to aid in understanding the options, best practices, and packaging implications.

One of the key checks the security review process described in the previous chapter makes is to scan the code to ensure it is using the appropriate Apex conventions to enforce the security rules administrators of your application configure, as not all security checks are enforced automatically for you.

This chapter discusses...

Platform APIs

Salesforce provides a number of APIs to access and manipulate records in its own objects that belong to applications such as CRM; these APIs are also extended to support Custom Objects created by admins or provided by packages installed in the subscriber org. Salesforce dedicates a huge amount of its own and community-driven documentation resources you can reference when educating partners and customer developers on the use of these APIs. Thus, it is important that your application works well with these APIs.

Platform APIs are enabled for Enterprise Edition orgs and above, though if you have a need to consume them in Professional or Group Edition orgs, Salesforce can provide a Partner API token (following the completion of a security review) to enable their use; this is unique to your application and so does not provide access for code other than yours.

Typically...

Localization and translation

It is important to take localization and translation into consideration from the beginning as it can become difficult and costly to apply it later. Fortunately, the platform can do a lot of work for you.

Localization

When using the native user interface, it automatically formats the values of numeric and date fields according to the Locale field on the user profile. Visualforce pages using the apex:outputField and apex:inputField components will automatically format values, and outputting local sensitive values in any other way will need to be handled manually in your Apex controller code or in your JavaScript code. Lightning components using lightning:outputField and lightning:inputField...

Building customizable user interfaces

The most customizable aspect of the user interface your application delivers is the one provided by Salesforce through its highly customizable layout editor, which provides the ability to customize standard user interface pages (including those now delivered via the Salesforce1 mobile client) used to list, create, edit, and delete records.

Lightning Experience is the latest user interface experience available for your desktop users. Salesforce Classic or Aloha is the name given to the existing user interface. It's radically different both in appearance and technology. Fortunately, your existing investments in layouts and Visualforce are still compatible. Lightning, however, does bring with it a more component-driven aspect, and, with it, new tools that allow even greater customization of the overall user experience.

Keep in mind...

Email customization with email templates

Using Apex, you can write code to send emails using the Messaging API. This allows you to dynamically generate all attributes of the emails you wish to send: the from and to address, subject title, and body. However, keep in mind that end users will more than likely want to add their own logo and messaging to these emails, even if such emails are simply notifications aimed at their internal users.

Instead of hardcoding the structure of emails in your code, consider using email templates (under the Setup menu). This feature allows administrators in the subscriber org to create their own emails using replacement parameters to inject dynamic values from records your objects define. Using a Custom Setting, for example, you can ask them to configure DeveloperName of the email template to reference in your code. You can package email templates...

Process Builder, Workflow, and Flow

Salesforce provides several declarative tools to implement business processes and custom user experience Flows. End user operations such as creating, updating, or starting an approval process for a record can be customized through two tools, known as Workflow and Lightning Process Builder. When you need to implement a UI Flow that provides a wizard or interview-style user experience, you can use the Lightning Flow tool. This tool can be used to define more complex conditional business processes that need to read and update records. Automation Flows, or sometimes "headless Flows," are Flows that do not interact with the user and can be referenced within Apex code as well as Process Builder.

Lightning Flow lets you build engaging UIs but has its limits since it is not a programming language in a traditional sense. This does not mean...

Social features and mobile

Chatter is a key social feature of the platform; it can enable users of your application to collaborate and communicate contextually around the records in your application as well as optionally inviting their customers to do so, using the Chatter Communities feature. It is a powerful aspect of the platform but covering its details is outside the scope of this book.

You can enable Chatter under the Chatter Settings page under Setup, after which you can enable Feed Tracking (also under Setup) for your Custom Objects. This setting can be packaged, though it is not upgradable and can be disabled by the subscriber org administrator. Be careful when packaging references to Chatter such as this, as well as including references to the various Chatter-related objects, since this will place a packaging install dependency on your package, requiring all your customers...

Creating and testing a new package version

If you are following along instead of using the source code provided for this chapter, be sure to run sfdx force:source:pull to synchronize the changes made in this chapter. Take the time to review your project file contents after completing the steps in this chapter and then perform another package creation and test an install of the new package in a separate testing scratch org. If you need a reminder of these steps, refer to Chapter 1, Building and Publishing Your Application.

Do not forget to update your ancestry configuration in your sfdx-project.json file as per the instructions in Chapter 1, Building and Publishing Your Application, to reference the package version created in that chapter; otherwise, your new package will not be eligible to upgrade from a previous version install.

If you choose to perform the install...

Summary

In this chapter, you have seen a number of platform features that directly help you build key structural and functional aspects of your application without writing a line of code, in turn, further enabling your customers to extend and customize their application. The chapter also focused on optimizing the tasks performed by consultants and administrators to install and configure an application. Finally, you were made aware of limits imposed within the subscriber org and ways to avoid them, and now have an awareness of them when packaging your application.

Continue to review and evolve your application by first looking for opportunities to embrace these and other platform features and you will ensure that you and your customers' strong alignment with the current and future platform features continues to grow. In the next chapter, we will dive deeper into options...

lock icon
The rest of the chapter is locked
You have been reading a chapter from
Salesforce Lightning Platform Enterprise Architecture - Third Edition
Published in: Nov 2019Publisher: PacktISBN-13: 9781789956719
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime

Author (1)

author image
Andrew Fawcett

Andrew Fawcett has over 30 years of experience holding several software development-related roles with a focus around enterprise-level product architecture. He is experienced in managing all aspects of the software development life cycle across various technology platforms, frameworks, industry design patterns, and methodologies. He is currently a VP, Product Management, and a Salesforce Certified Platform Developer II at Salesforce. He is responsible for several key platform features and emergent products for Salesforce. He is an avid blogger, open source contributor and project owner, and an experienced speaker. He loves watching movies, Formula 1 motor racing, and building Lego!
Read more about Andrew Fawcett