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.

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

codymaines

Cody Maines

Written by

Salesforce Developer, UX Advocate, and general tech enthusiast.

codymaines

Salesforce Developer, UX Advocate, and general tech enthusiast.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade