Other Articles in Reports & Dashboards

How to Create a Link or Button that Sends You to a Dynamic Salesforce Report

Steps

  1. Go to Setup –> Object Manager –> Account (with respect to object)
  2. Click on Button, Links, and Actions. Click on ‘New Button or Link’.
  3. Enter into the Label field what you want the custom link/button to be called. 
  4. Optional to enter in the Description field, a brief summary of what the link/button will represent. 
  5. Should you choose to create a button, select ‘Detail Page Button’ on the display type field.
    1. (**The ‘Detail Page Link’ option will only show under custom links on a ‘Detail’ section of the object.)
  6. Select your ‘Behavior’ options as necessary, in this case, ‘Display in a new window’ was selected. 
  7. Select ‘Content Source’ to be URL and open up a new tab to proceed with step 8. 

  1. In a new tab, go to the Salesforce report you created and make sure it is created off of a report type that includes both object’s funds and accounts (data must be structured where both objects have a relationship to each other, e.g. account is lookup field on fund level, or fund is a related list on account) to allow you to bring in the necessary field that will be filtered on per step 9. Group by rows the ‘Account Name’ field to allow you to visualize your data per Account and all the funds associated with that account. 
  2. Add a field filter to the report to include an ‘Account ID’ field set to ‘equal to’ blank (leave the input cell blank). Also, make sure to leave the ‘locked’ checkbox unchecked so the parameter is able to pass the account ID into this report filter to dynamically show you the data from the specific account record you are viewing. Copy and paste the URL of your Salesforce report up through the ‘https://….view?’;. 

  1. If you go back to the custom button/link you were editing, you’ll paste the URL you copied from step 10 of the Salesforce report into that textbox. 
  1. Add ‘fv0={!Account.Id}’ to the end of that URL link you pasted from step 10.
    1. **If the Account ID field is the 1st field you added as a filter to the report, use fv0 as indicated(Salesforce by default will add two field filters into all Salesforce reports so the third field added is considered fv0, the 4th field added as a filter is considered fv1, etc). So wherever you decide to add the ‘Account ID’ filter in your report, specify the fv# that you’ll copy and paste into the custom button/link you create. 

  • The best practice is to use the ‘Select Field Type’ dropdown and select the object(account).
  • Click on ‘Insert Field’ and select ‘Account ID’ which will populate the merge field. 

  1. Click ‘Check Syntax’ to ensure the code/link runs without any syntax errors in merge fields or functions. Hit Save. 
  2. Go to the object (Account) page layout you want this button/link to be visible on via setup. For the button, add the newly created button from the ‘Mobile & Lightning Actions’ to the ‘Salesforce Mobile and Lightning Experience Actions’ section of the layout. For the link, add the newly created link from the ‘Custom Links’ to the ‘Custom Links’ section of the layout. Save the page layout. 
  3. Now if you go to an account record you should see your ‘Fund Summary’ button or if you added a custom link, you will locate this in the ‘Details’ section of the record. Once you click on the link/button, you will see the funds (and other fields you included in the report) associated with the specific account.