The Matrix Lightning Web Component

The RH Matrix showing a quarter of forecast hours across six resources, with live column totals along the bottom.

The RH Matrix (the Matrix Lightning Web Component) makes it easy to enter and manage data quickly and efficiently. Similar to a spreadsheet, you can select cells, navigate using your keyboard, and enter or update values directly. You can also copy and paste data, highlight ranges, and use the drag handle to fill adjacent cells with just a few clicks. Totals resolve underneath as you type, and utilization coloring updates in real time, so you can plan ahead across a whole quarter in one pass.

Prerequisite: Lightning Web Security

The RH Matrix requires that administrators have enabled Lightning Web Security in their org. This is an org-wide Setup change, so review it before you plan a rollout. For details, see Salesforce Help: Lightning Web Security.

If your matrix does not have a totals row along the bottom or a Today button in its toolbar, you are on the earlier Visualforce version. See Migrating from the Legacy Visualforce to the Lightning Web Component Matrix.

Using the Matrix

  • Select a cell by clicking it with your mouse or navigating to it using the arrow keys.
  • Begin typing to overwrite the existing value, or double-click to edit the current value directly.
  • Press Enter to move to the cell below, or Shift + Enter to move to the cell above.
  • Use Tab to move to the next cell to the right, and Shift + Tab to move to the cell to the left.

Highlighting and Selecting

  • Click and drag your mouse to highlight a range of contiguous cells.
  • Non-contiguous ranges cannot be selected.

Copy and Paste

  • Use standard keyboard shortcuts (Ctrl + C / Cmd + C to copy, Ctrl + V / Cmd + V to paste).
  • When pasting, the data will adjust to fit the selected area if there is enough space. A single copied value pastes across an entire highlighted range.
  • If the paste operation exceeds the available space, for example pasting 4 rows into a space with only 2 available rows, the data will be truncated.

Drag to Fill

  • Use the handle at the bottom-right corner of a selected cell or range to drag and fill adjacent cells.
  • The dragged cells replicate the original value. It does not apply a pattern or sequence.

The Summary Row

The bottom row of the matrix carries live column totals. It updates as you type, before you save, so you can see what a plan adds up to per week without exporting anything or building a report.

The summary row is controlled by the Show Grand Total Row property, which is enabled by default.

The RH Matrix totals row showing per-column totals beneath the resource rows.
The summary row: live column totals.

Utilization Coloring in the Matrix

As hours are entered, the matrix draws a color bar under each value showing how utilized that resource is for the period:

BarMeaning
GrayBelow the resource’s target
GreenWithin the resource’s target
RedOver the resource’s target

Two things about it are worth knowing:

  • It updates as you commit a value, not on save. Type a number, press Tab, and the bar and the column total move together.
  • It reflects the resource’s entire load, not just this project. The matrix totals every record that resource is assigned to for the selected day, week, or month before comparing against their target. That is why two cells showing the same number can be colored differently: the same 40 hours can be green in August and red in October, because the person is already committed elsewhere in October.
Close-up of RH Matrix cells showing gray, green and red utilization bars beneath the values as the entered hours increase.
The same cell at 20, 40 and 50 hours. The bar and the column total move together.

Where the targets come from. Targets are read from each resource’s capacity records, which define working hours per day over a date range. See The RH Capacity Object and Enhanced Resource Capacity Planning. Orgs still on the earlier setup use the resource’s Weekly Target Min/Max Hours fields instead, documented on Set up your company’s Resources.

To leave particular hours out of that calculation, see Exclude hours from utilization coloring and the Assignment Exclusion Field. The three colors themselves are configurable org-wide: see Change org-wide Resource Hero configuration settings.

Saving

When you make changes in the matrix, you will see a “You have unsaved changes” message in red at the top of the matrix. To save your changes:

  • Click the Save button (floppy disk icon) in the top-right corner of the matrix.
  • Once saved, the “You have unsaved changes” message will disappear.

How Data is Saved in Salesforce

The way data is saved depends on the selected View By setting:

View BySaving Behavior
Day or Time TrackingData is saved exactly as entered. If you enter 4 for a specific date and assignment, it will save 4 hours for that date.
Week or MonthData is distributed based on the work week settings.
For example, if you enter 20 in the week view and your work week is set to 5 days (Monday to Friday), the matrix will split the 20 hours into 4 hours per day.

Date Navigation

The RH Matrix lets you choose a time range, change the level of detail (Day, Single Week, Week, Month), and anchor the view on key dates from the parent record. The currently selected cell serves as the focused date, so switching views keeps your place.

For example, if a cell in May is selected and you switch to Day view, the matrix shifts to show the days of May. If you have a cell selected in June within the 2nd Quarter and switch to Next 3 Months, the view starts at June and shows the following three months.

The RH Matrix anchor date control open, showing Today, RH Project Start Date and RH Project End Date.
The anchor date control jumps the view to Today, or to a date from the parent record.

For full detail on time ranges, context preservation, and anchor dates, see Date Navigation Controls.

Adding the Matrix to a Lightning Page

  1. Go to SetupUser InterfaceLightning App Builder.
  2. Open the Lightning page where you want the matrix, or create a new page.
  3. From the Components panel, search for RH Matrix and place it on the page.
  4. Use the settings panel on the right to adjust the available options. See the table below.
  5. Save your changes, and activate the page if needed.

If you are replacing the earlier Visualforce version on an existing page, follow Migrating from the Legacy Visualforce to the Lightning Web Component Matrix instead. It covers the order to do it in and the one property you have to set.

Configuration Options

The following properties are available when configuring the RH Matrix:

NameDescriptionAvailable ValuesDefault
Header LabelThe label that appears at the top of the matrix.Any textResource Hero Matrix
Matrix TypeDetermines how the matrix behaves and what data is displayed.

The available values depend on where you place the component, see Matrix Type by Page Type below.

For details, view the RH Matrix: The Matrix Type Setting support page.
Varies by page typeVaries by page type
Default ViewBy / Time RangeSets the default time view and range.Single Week

Day – Current Month
Day – Last 7 Days
Day – Last 14 Days
Day – Next 7 Days
Day – Next 14 Days

Week – Current Quarter
Week – 1st Quarter
Week – 2nd Quarter
Week – 3rd Quarter
Week – 4th Quarter
Week – Next 3 Months
Week – Next 6 Months
Week – 1st Half
Week – 2nd Half

Month – Next 12 Months
Month – Entire Year
Week – Next 3 Months
Lock View ByWhen checked, end users cannot change the View By selector at runtime. The selector appears disabled with a label explaining the locked state, and the locked value comes from the Default ViewBy / Time Range property.True
False
False
Matrix Enabled FieldControls which numeric field the matrix manipulates.

Choose — Manual — to specify fields yourself in the property below.

More information about configuring additional numeric fields to work with the RH Matrix can be found on the Create a matrix on fields other than Forecast and Actual support page.
Forecast
Actual
— Manual —
Forecast
Manual Matrix Enabled FieldsUsed when Matrix Enabled Field is set to — Manual —. Manually sets which fields are enabled in the matrix.Comma-separated list of Resource Forecast field api names.

For example:

ResourceHeroApp__Forecast__c,ResourceHeroApp__Actual__c
None
Sort By FieldField used to sort matrix rows.Any field from Resource Assignment objectresourceheroapp__assigned_to__c
Sort By OrderSort order for the matrix rows.ASC
DESC
ASC
Assignment Exclusion FieldField used to exclude records from the matrix.

More information can be found on the Assignment Exclusion Field support page.
Any checkbox / boolean field from Resource Assignment objectNone
Resource Assignment Field Set NameControls which row header fields will be displayed within the Matrix.

Any field set from the Resource Assignment object can be specified.

For more information on creating field sets for use within the matrix, see the RH Matrix: Custom Field Set support post.

If left blank, default fields from the RHA Matrix Fields custom setting will be used.
Any field set from Resource Assignment objectNone
Anchor Date Field SetThe field set supplying the dates in the anchor date control.

Until this is set, the anchor date control does not render.

The field set must live on Resource Assignment and hold dotted paths to the parent record’s dates, for example RH_Project__r.Start_Date__c.
Any field set from Resource Assignment objectNone
Component Max HeightMaximum height of the component in pixels.

Once this limit is reached, scrollbars will appear.
Integer300
Notes PanelDetermines the default state of the Notes panel for Day and Single Week views.Default Open
Default Closed
Hidden
Default Closed
Show Grand Total RowShows or hides the grand total row at the bottom of the matrix.True
False
True
Read OnlyMakes the matrix read-only.True
False
False

Matrix Type by Page Type

The Matrix Type values you can choose depend on the kind of Lightning page the component sits on:

Where the component is placedAvailable ValuesDefault
Record pageSingle RecordSingle Record
App page or Home pageRH Dashboard
Standalone
Standalone
Experience Cloud pageRH Dashboard
Standalone
Single Record
Standalone

Experience Cloud Specific Configuration Options

In addition to the above, the following configuration options are available within Experience Cloud:

NameDescriptionAvailable ValuesDefault
Record IdWhen Matrix Type is Single Record (you are adding this component to an experience cloud record detail page), enter {!recordId} in this field.

When Matrix Type is Standalone or RH Dashboard, leave this field blank.
blank
{!recordId}
blank
Object API NameWhen Matrix Type is Single Record (you are adding this component to an experience cloud record detail page), enter {!objectApiName} in this field.

When Matrix Type is Standalone or RH Dashboard, leave this field blank.
blank
{!objectApiName}
blank
Note:

Anchor Date Field Set is not available on Experience Cloud pages. The anchor date control therefore does not render there.

Permissions and Access

  • The RH Matrix enforces object and field-level security on the records it displays and edits.
  • Matrix editing is governed by Resource Forecast permissions, not Resource Assignment. A user needs Read on Resource Assignment for the Matrix to display, Edit on Resource Forecast for cells to be editable, and record-level edit access to the assignment itself (from your org-wide defaults, sharing rules, the role hierarchy, or ownership).
  • The Matrix does not enforce Create or Delete on Resource Forecast separately. Because every empty cell in the grid is potentially a new Forecast record, a user with Edit access can also enter time on a date that has no Forecast yet, and clear one that does. To restrict that, use a validation rule on Resource Forecast rather than withholding Create or Delete access. Scope any such validation rule to standard assignments, for example by checking Resource_Assignment__r.Is_Standard__c. Holiday schedules, PTO and snapshots also create Resource Forecast records through their own processes, and an unscoped rule will block those too.

Still on the Earlier Visualforce Version?

Two things tell you which matrix you are looking at: a totals row along the bottom, and a Today button in the toolbar. The RH Matrix has both. The earlier Visualforce version has neither.

Migrating is a page change in Lightning App Builder. Your data does not move, nothing is rebuilt, and the Visualforce page is not deleted.

Migrating from the Legacy Visualforce to the Lightning Web Component Matrix

The earlier Visualforce matrix and the RH Matrix showing the same project plan, with the totals row and Today button present only on the RH Matrix.
Same project, same plan. Only the RH Matrix has a totals row and a Today button.

Ready to get started?

Schedule a call to see if Resource Hero is right for you

Book now