Modify the User Experience
What You’ll Do
- Modify the Battle Station page layout.
- Add a Roll-up Summary for Resources.
Page layouts allow you to customize the look and feel of detail and edit pages in Salesforce. You can also use page layouts to control which fields, related lists, and custom links users see, which standard and custom buttons appear on detail pages and related lists, and determine whether fields are visible, read only, or required on detail and edit pages. Yes... you can do a lot with page layouts.
Modify the Battle Station Page Layout
You are going to move some fields around and add a few related lists to make the user interface more productive and appealing.
You can edit the page layout from the Custom Object definition page. But first you need to add a new Battle Station record.
Click the to access the App Launcher, then select the Battle Station Construction app. Click the Battle Stations tab, then the New button. Enter any name that you'd like for your Battle Station (Obliteration Station has a nice ring to it!) and then Save the record.
What you see now is the default layout for the Battle Station that the Salesforce Platform generated for you. Let's move some fields around to make this easier to work with. We'll move the Project and Weapons Status fields to the right a little.
Click and select Setup. This launches Setup in a new tab.
Click the Object Manager tab next to Home.
Click the name of your object (in this example, click Battle Station)
Select the Page Layouts and select the Battle Station Layout.
Scroll down to the Battle Station Detail section and drag the Project Status field to the right column.
Drag the Weapons Status field to the right column.
There's a lot more info for the related list records than is currently showing. Edit the layout for the related lists to include more info on the page.
Click the wrench icon next to the Resources label in the related list to bring up the properties editor modal.
Add the Quantity and Utilization field to the right side by selecting them and clicking the Add arrow in the middle.
Click OK to close the modal.
Do the same thing for the Supplies related list and add the Quantity, Unit Cost, and Total Cost fields, in that order.
If you like the way things look, or even if you don't, click the Save button in the floating layout editor in the top left.
Add Some Battle Station Data
Now that you have your page layout looking awesome, it's time to enter some data so you can really get a feel how the application functions.
It takes a large number of people to build and operate a Battle Station so let's assign some resources to your project. Enter some resource records and set the quantities you may need plus a target utilization percentage. Feel free to be as creative as you'd like. Here are some types of resources you might need to build your Battle Station:
Click the to access the App Launcher, then select the Battle Station Construction app. Click the Battle Stations tab, and then select the Obliteration Station record. Under the Related tab, click New on the Resources list.
Left-handed monkey wrench adjuster
Robert the foreman
Exhaust port inspector
Battle trooper with ridiculously thin armor & terrible aim
Now you need to do the same thing for supplies and equipment. Here is some "stuff" that you might need to build a Battle Station:
For the Obliteration Station record, you need to add the supplies. Under the Related tab, click New on the Supplies list.
Planet-destroying laser (typically a quantity of 1)
Hot glue gun
Cantina band instruments
Laser protecting eyewear (that is, sunglasses)
Add a Roll-Up Summary Field
As projects grow it becomes difficult to keep a handle on what's going on. As you add more and more resources, it's hard to tell how many people are actually assigned to the project based on the limited number of records that display in the related list section. Let's fix this so you can see the total number of resources at a single glance.
When we created the Master-Detail relationship from resources to battle stations, it provides us with some additional functionality for free. You can create a roll-up summary field that will automatically display the total number of resources on the Battle Station record.
Click and select Setup. Click the Object Manager tab next to Home.
Click Battle Station.
Select the Fields & Relationships section from the left navigation.
Click the New button.
For Data Type, select Roll-Up Summary, and click Next.
Fill in the custom field details and click Next
- Field Label:
- Field Name:
- Field Label:
For your summary calculation, choose Resources as the Summarized Object, select Sum for the Roll-Up Type and then choose Quantity as the Field to Aggregate.
Click Next again to accept the default field visibility and security settings.
Click Save to add the Crew Members field to the page layout and save the Crew Members field.
Now go back to your Battle Station record and you should see a total of all resources underneath the Battle Station Name. Please refresh the browser page, if the changes are not visible. Pretty nifty, huh?