Reader small image

You're reading from  Force.com Enterprise Architecture - Second Edition

Product typeBook
Published inMar 2017
Reading LevelIntermediate
PublisherPackt
ISBN-139781786463685
Edition2nd Edition
Languages
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

Chapter 2. Leveraging Platform Features

In this chapter, we will explore some key features of the Force.com platform that enables developers to build the application more rapidly, but also provides key features to 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 by the correct level of integration options and that they need to interface their solutions with yours; the platform also plays a key role here.

As we expand our FormulaForce package, we will explore the following to better understand some of the decision making around platform...

Packaging and upgradable components


The time taken to install your application and get it prepared for live usage by your customers is a critical phase in 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 which of the components you are using are packable and upgradeable are important to monitor the effort involved at this stage.

When exploring the various platform features available to you, it is important to check whether the related component type can be packaged or not. For a full list of components that can be packaged, search for the Available Components section in ISVforce Guide, referenced in the previous chapter.

https://developer.salesforce.com/docs/atlas.en-us.packagingGuide.meta/packagingGuide/

Tip

If a component type relating to a feature you wish to use cannot be packaged, it does not necessarily mean it is of no use to you or your users, as it may well be something...

Understanding the custom field features


Custom fields carry many more features than you might think; they are much more than simple field definitions you find on other platforms. Having a good understanding of a custom field is the key to reducing the amount of code you have to 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 in some cases, through the APIs. You can define a default value based on a formula using either literal values and/or variables such as $User, $Organization, and $Setup.

Let's try this out. Create a Year text field on the Season object as per the following screenshot...

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 to provide 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 an 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 that 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 the following two categories of security as provided by the platform:

  • Functional security: Security...

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 security review completion) to enable their use; this is unique to your application and so does not provide access for code other than yours.

Typically, unless you are developing an off-platform utility or integration to accompany your application, you may not find your application...

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 the 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.

Tip

It's not always possible to use the Visualforce apex:inputField and apex:outputField tags as described earlier in this chapter. For example, if the information you are displaying is not contained within a Custom Object field, but in some calculated view state in your Apex Controller. The format methods on various type classes such as Date, DateTime...

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 that provides the ability to customize the standard user interface pages (including those now delivered via the mobile client Salesforce1) 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. Its 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 to that allow even greater customization of the overall user experience.

Keep in mind any user experience you deliver that is not leveraging the standard user interface takes added effort on behalf of the developer...

E-mail customization with e-mail templates


Using Apex, you can write code to send e-mails using the Messaging API. This allows you to dynamically generate all attributes of the e-mails 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 e-mails, even if such e-mails are simply notifications aimed at their internal users.

Instead of hardcoding the structure of e-mails in your code, consider using email templates (under the Setup menu). This feature allows administrators in the subscriber org to create their own e-mails 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 e-mail template to reference in your code. You can package e-mail templates as starting points for further customization, though keep in mind that they are not upgradable.

Tip

If data...

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 Process Builder. When you need to implement a UI flow that provides a wizard or interview style user experience, you can use the Visual 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 Visual Flows that do not interact with the user and can be referenced within Apex code as well as Process Builder.

Process Builder is the successor to Workflow. It provides the same functionality as it plus additional features for updating child records for example and extensibility for developers. It is also easier for end users to build and visualize more complex processes with its more...

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 invite 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 to also have this feature enabled.

By creating actions on your Custom Objects, you can provide a quick way for...

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, and 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 the application. Finally, you were made aware of limits imposed within the subscriber org, the ways to avoid them, and to have an awareness of them when packaging.

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 continue to grow. In the next chapter, we will dive deeper into options and features surrounding the storage of data on the platform.

Tip

Be sure to reference the Salesforce Limits Quick Reference Guide PDF...

lock icon
The rest of the chapter is locked
You have been reading a chapter from
Force.com Enterprise Architecture - Second Edition
Published in: Mar 2017Publisher: PacktISBN-13: 9781786463685
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 £13.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