Skip to main content

Update the Lightning Page and Test the Project

It’s Almost Time to Rock

OK, by now you uploaded an audio file, installed a package, and created a custom metadata record. The final step is to update the opportunity page, so that your component will play the audio file you uploaded.

Create an Opportunity

Create a sample opportunity. 

  1. From the App Launcher ( ), find and select Sales.
  2. Click Opportunities.
  3. Click New.
  4. Create the opportunity as follows:
    • Opportunity Name: Winning Deal
    • Stage: Prospecting
    • Close Date: select any future date
  5. Click Save.

Update the Opportunity Page

Now, update the page to use the custom Trailshred Audio Player component.

  1. From your sample opportunity record, click Setup and select Edit Page. This opens Lightning App Builder. You use Lightning App Builder to update the page.
  2. Enter audio in the Search Components box, then drag the Trailshred Audio Player custom component onto the canvas and drop it at the bottom of the page. Be sure not to drop the component inside any existing components on the page.

Adding custom Trailshred Audio Player component to the canvas.

The component has no visible content, so you should see an outline around a transparent box at the bottom of the canvas.

Custom Trailshred Audio Player component added to the canvas.

Activate the Opportunity Page

Save your changes and activate the modified page for your users.

  1. Click Save.
  2. Click Activate.
  3. Select Assign as Org Default.
  4. Leave the form factor selection as is and click Next.
  5. Click Save.
  6. Click Back button to return to your sample opportunity record.

Test the Project

It’s time to test it out! You should be back on your sample opportunity, but if not, from the App Launcher ( ), find and select Sales, click Opportunities, and open the Winning Deal opportunity.

Make sure you turn up your speakers on your computer and get ready to rock.

  1. Click Edit.
  2. For Stage, select Closed Won.
  3. Click Save.

And listen to the sounds of your audio clip play!

Note

Did the audio not play? Try these steps:

  • Ensure you activated your changes to the Opportunity record page.
  • Ensure your opportunity record’s Stage was not already Closed Won. The component only plays audio when the field value changes to the configured value in the custom metadata record.
  • Ensure the file you uploaded as a static resource is an audio file with extension .mp3 or .wav.
  • Ensure your Trailshred Setting custom metadata record is configured correctly, such as the Audio Static Resource Path matches your static resource name exactly, which may not be the same name as the file you uploaded from your computer.
  • If you added the component to a tabbed section on the record page, ensure that tab is focused before editing the record. If the component is in an unfocused tab then the audio won’t play.

You Did It!

You just added some customized fun to your org, including:

  • An audio file
  • An installed package, which includes a Lightning Web Component
  • A custom metadata record
  • An updated opportunity page

Well done. Now go forth and rock it in Salesforce!

Keep learning for
free!
Sign up for an account to continue.
What’s in it for you?
  • Get personalized recommendations for your career goals
  • Practice your skills with hands-on challenges and quizzes
  • Track and share your progress with employers
  • Connect to mentorship and career opportunities