Advanced customization and how to’s

Setup Resource Hero on a custom or standard object

Create a new lookup field to your object

  1. From Setup, click on the Object Manager tab.
  2. From the quick find search box, enter Resource Assignment, then click on the link for the Resource Assignment object
  3. On the left side, click on Fields and Relationships section, then click the New button.
  4. Select Lookup Relationship as your field type, then click Next.
  5. Select your object from the Related To drop down, then click Next.
  6. Enter your desired Field Label and Field Name.  Write down the Field Name as we will need this later on.  Group and Professional Edition customers should ensure that the What to do if the lookup record is deleted radio button is set to Don’t allow deletion of the lookup record that’s part of a lookup relationship.  Click Next.
  7. Review Field Level Security settings, then click Next.
  8. Review Page Layout settings, then click Next.
  9. Review the Related List settings, then click Save.


Add custom setting entry

This step will allow Resource Hero to know how to find your custom object.

  1. From Setup, enter Custom Settings in the quick find search box, then click on the Custom Setting link on the left.
  2. In the list of Custom Settings, click the Manage link next to RHA Object Translation.
  3. Click the New button.
  4. On this page, enter the information based on the below details.

    Name (Ex.  Project__c) – This is the API name of the Resource Assignment lookup field that we created in the previous step.

    NameField (Ex.  Name) – This is the API name of the field on your custom object that you will show in the matrix that will link to your custom object’s detail page.  Usually this will be the Name field, however, in certain circumstances you may wish or need to use another field.  For example, if you were configuring Resource Hero on the case object, you would want to enter Subject.

    Namespace – Only used when your custom object was created as part of a managed package installation.  The Namespace, if any, can be found on the object detail page.

    Object Name (Ex.  Project__c) – This is the API Name of the object that we are configuring. Note: Both the Namespace and Object Name can be found on the Object detail page. From Setup, enter the word Object in the quick find search box, then click on the Objects link on the left. Click on the Label of the desired Custom Object. The namespace is listed here.

  5. Click Save.

Create a new Visualforce Page

  1. From Setup, enter Visualforce Pages in the quick find search box, then click on the Visualforce Pages link when it is displayed.
  2. Click the New Button.
  3. Enter in a Label for the new page, for example, Project Forecast Matrix.
  4. By default, Salesforce will automatically enter the same name in the Name field.  Edit the default to include underscore characters instead of spaces.  For example:  Project_Forecast_Matrix
  5. In the main Visualforce Markup section, copy and paste the following markup that we will modify:
<apex:page standardcontroller="[Object API Name]" id="ResourceHeroPage">
		ActualOrForecast = "Forecast"
		ForceReadOnly = "False"
		PageURL = "/apex/c__[Page Name]"
		DefaultViewBy = "Week"
		DefaultTimeRange = ""

Copy to Clipboard
  • There are several sections of this code that we need to modify. Once complete, click Save.

[Custom Object API Name] – Enter the API name of the object that you are setting up Resource Hero on.  API names can be found on the object detail page in setup as mentioned above.

ActualOrForecast – Determines what type of data you would like to have displayed in the matrix, Forecasts or Actuals.

  • Forecast (default)
  • Actual

ForceReadOnly – Change this setting only if you want to force all data displayed in the matrix to be read only.

PageURL – This setting is used internally by resource hero for page navigation.  It will always be the ‘/apex/c__’ as a prefix followed by the name of the page that you are creating.

DefaultViewBy – Determines how you would like the columns to display data in the matrix by default:

  • Week (Default):  each column in the matrix represents a single week.
  • Day – each column represents a single day.
  • Timetracking – same as the Day view, but shows only a week at a time and displays the notes section by default.

DefaultTimeRange – Determines the time range that is displayed in the matrix by default.  Unless you have a specific business case not to do so, you can leave this blank and the matrix will automatically display the correct time range for whatever the current date is.  For example, if you are creating a matrix with the DefaultViewBy as Week, when viewing the matrix on 8/1/2016, time range will default to 3rd Quarter.

Available options for the Week view by:

Entire Year

1st Half

2nd Half

1st Quarter

2nd Quarter

3rd Quarter

4th Quarter

Next 3 Months

Next 6 Months

Next 12 Months

Next 24 Months

Available options for the Day view by:












Available options for the Month view by:

Entire Year

Next 12 Months


MatrixHeight– Change this setting only if you want to force this matrix to be a different height than the global default.

ManageAssignmentsButtonVisible – Determines whether the Manage Assignments button is visible.

  • true (default)
  • false

QuickAssignButtonVisible – Determines whether the Quick Assign button is visible.

  • true (default)
  • false

ArchiveButtonVisible – Determines whether the Show / Hide Archive button is visible.

  • true (default)
  • false

NotesButtonVisible – Determines whether the Show / Hide Notes button is visible.

  • true (default)
  • false

FullScreenButtonVisible – Determines whether the Full Screen button is visible.

  • true (default)
  • false

SaveButtonVisible – Determines whether the Save button is visible.

  • true (default)
  • false

NotesDefaultOpen – Determines whether the Notes section is toggled open by default.

  • true (default)
  • false


In our example, the final result would look like the following:

New visualforce page

Note:  After saving the Visualforce page, access will be granted to the System Administrator profile.  Additional access can be granted to the page by profile or permission set:  Visualforce Page Security


Add the new Visualforce Page to your object’s page layout

  1. From Setup, click on the Object Manager tab.
  2. From the quick find search box, search for the desired Object, then click on the object name
  3. Under the Page Layouts section, click edit next to page layout that you wish to add Resource Hero to.
  4. Create a new single column page section with Resource Hero as the title.
  5. On the top page layout edit hover, select Visualforce Pages from the left, then drag your visualforce page to the section that you just created.
  6. Click the Properties icon on the Visualforce Page and change the height setting to 350px.  Click OK.
  7. Make any other desired change, then click Save.


At this point, Resource Hero should be working.  If you navigate to one of your custom object records you should now see the following:

Resource Hero is now working



Adding additional resource hero fields

The following fields, when created on your custom object, will be automatically kept up to date by Resource Hero.  While you could choose whatever you like for the field Label, take special care to copy the field names exactly as is listed.

Resource Hero Calculation Fields (PDF)

Resource Hero Status Fields (PDF)



Create a trigger

This step should only be followed by customers with Enterprise edition or above.  Customers with Group, Professional or other editions of Salesforce should view the Considerations when using Resource Hero on Group or Professional edition support page.


This trigger will enable the following functionality for your object:

  • Enables the Archive Resource Assignments checkbox.  See details on the Resource Hero Fields page.
  • When a record is deleted all related Resource Hero records (assignments / forecasts) are deleted with it.
  • Ensures that some text fields on Resource Assignment records (Assigned To, for example) are kept in sync with changes to your object.  These fields are typically only used on Group Edition reports and will not impact the display of the matrix.


Creation of apex trigger and related test classes must be done in a Salesforce sandbox and then moved to production using any of the approved metadata migration tools ( Migration Tool, Workbench, IDE, etc.).  Details for creating the trigger (and related test class) can be found here.


Regardless of your Salesforce edition, if you do not create a trigger for your object you must ensure that the lookups that were created in the Create a new lookup field to your object section above have their What to do if the lookup record is deleted radio button set to Don’t allow deletion of the lookup record that’s part of a lookup relationship.


If you are not comfortable with this process, send an email to and we can help!

Have more questions?

Contact Us