function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Chris Heath 7Chris Heath 7 

"Create & Edit Visualforce Pages" Challenge - Console Command not working

Hello all,

In the Create & Edit Visualforce Pages challenge, for #6 in the first part they ask you to run a command in Console to make the page look like Lightning. When I run this command, I am receiving the error "Uncaught ReferenceError: $A is not defined at <anonymous>:1:1".

Has the command changed?

Thank you!
Sandeep WaliaSandeep Walia
Hi Chris,

Please make sure that you are in the Lightning Experience at the time when you execute this command from the console. I am attaching a screenshot where I am redirected to the  desired page on execution of the command.

Before execution:
User-added image

After execution:
User-added image

The reason you are getting $A as undefined is most probably because you were using the salesforce classic experience.


Hope this helps,
Sandeep
 
Mark BranscumMark Branscum
I ran into the same problem because the instructions left out a little detail.  Don't open the Javscript console in the preview page it tells you to open in the immediately preceding step, even though that would be the natural assumption IMHO.  Instead go back to any page in Salesforce lighting, open the Javascript console there and then run the command.
Bradley CraigBradley Craig
I encountered the same.  I agree with MB above: "... the instructions left out a little detail."  Open the browser's Javascript console while viewing a lightning page and then enter and run the command provided in the trailhead step #6:
$A.get("e.force:navigateToURL").setParams(
    {"url": "/apex/HelloWorld"}).fire();