Troubleshooting the Trailhead Validator

Cody Maines
Feb 8, 2018 · 1 min read

Anyone who’s done an interactive Salesforce Trailhead module knows that the validation can be… vague. A few weeks ago, I discovered the validation is executing anonymous as your user. Not only will these show up in the debug logs of your org, but you can see the code that ran (and thus run it yourself).

Steps

  1. Go to Setup > Debug Logs.
  2. Create a new log for your user. The default log levels should be fine.
  3. Run the validator in Trailhead.
  4. Refresh the debug log page and view the latest entry. You should see the first lines display the code that was run.
  5. (Optionally) Use a text editor to trim the lines, and then run them yourself in the developer console to troubleshoot the assertions in real time.
Image for post

You can also discover how extra data or something else in your org is messing with the expected validations. Interesting!

codymaines

Salesforce Developer, UX Advocate, and general tech…

Cody Maines

Written by

Salesforce Developer, UX Advocate, and general tech enthusiast.

codymaines

Salesforce Developer, UX Advocate, and general tech enthusiast.

Cody Maines

Written by

Salesforce Developer, UX Advocate, and general tech enthusiast.

codymaines

Salesforce Developer, UX Advocate, and general tech enthusiast.

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store