- Force.com Enterprise Architecture(Second Edition)
- Andrew Fawcett
- 711字
- 2021-07-09 18:31:05
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 users to perform common activities on records, for example, updating a contestant's status to DNF. These actions are also visible through the Salesforce1 Mobile application, so they enhance the productivity of the mobile user further compared to standard record editing.
Perform the following steps in the packaging org to try out the process:
- Enable Feed Tracking for the
Race
,Driver
, andContest
Custom Objects as described earlier; the fields being tracked are not important for the following steps, but you may want to select them all to get a better feel for the type of notifications Chatter generates. Also enable Publisher Actions from the Chatter Settings page. - Navigate to the
Contestant
object definition and locate the Buttons, Links and Actions section. Create a new action and complete the screen as follows: - When prompted to design the layout of the action, accept the default layout shown and click on Save. On the Contestant Action page shown, click on New to add a new Predefined Field Value option to assign
TRUE
to theDNF
field as part of the action to update the record: - Finally, edit the Contestant layout and drag the Out of Race action onto the layout (you may need to click on the override the global publisher layout link in the layout editor before you can do this).
- After performing these steps, you will see the Out of Race action being displayed in the UI as shown in the following screenshots. If you are viewing a Contestant record in the Salesforce Classic UI, the action is accessed from a drop down menu from the Chatter UI region of the page and will look like this.
If you are viewing the Contestant record in the Lighting Experience UI it will look like this:
Note
Notice how Lightning Experience relocates the Action "Out of Race" button from the Chatter UI in Salesforce Classic to include it alongside other buttons (top right) that are relevant to the record. A modal popup style is also used. This is one of many examples where Salesforce has adopted a different UX design for existing functionality you define.
Tip
You can enable the Lightning Experience UI for your user under the Setup menu and follow the onscreen instructions to enable it. Once enabled you can toggle between the two UI types.
If you are viewing the record via the Salesforce1 Mobile application, it looks like this:
Take time to review your package contents after completing the steps in this chapter and then perform another upload and test an upgrade of the package in your testing org. When installing the upgrade, you should see a confirmation page like the one shown in the following screenshot, showing new or changed components being installed:
Only a part of the screenshot is shown, though you can see that it shows the custom application, action, and Permission Set components added in this chapter. Further down, the upgraded confirmation page shows the updated Custom Object and new custom fields as shown in the following screenshot:
Tip
Notice that once you have upgraded the package in your testing org, the layouts for Season, Driver, and Race do not feature the new fields added in this release of the package. This is due to the fact that layouts are not upgraded.