+ Start a Discussion
Jon ManloveJon Manlove 

I am getting an error message when I try to enter code from the 'Create and Edit Visualforce pages' into the javascript console

Raj VakatiRaj Vakati
Can you share the code to find the issue 
Jon ManloveJon Manlove
Here's the code I was trying to insert into the Javascript console.  And I've inserted the image of the error code.

    {"url": "/apex/homeworld"}).fire();

User-added image
Ashif KhanAshif Khan
Hi Jon
if( (typeof sforce.one != 'undefined') && (sforce.one != null) ) { sforce.one.navigateToURL('/apex/helloworld');//to navigate 
 sforce.one.editRecord('rcrdId');//to Edit
 sforce.one.createRecord('objectName');//to Create Record

I hope this will help you
Jon ManloveJon Manlove
Just to clarify, the code in my original question is part of a Trailhead exercise, Create & Edit Visualforce Pages, and supposedly adds the Lightning features to the visualforce page I was working on as part of the exercise.  The instructions suggest I add the code to the javascript console not the visualforce page.  The code you've provided goes in the visualforce page I created, not the javascript console for the preview page.  Also, I'm not sure where the code you provided goes on my visualforce page.

This is how my preview page looks from the exercise:
User-added image
And this is how it is supposed to look, it has the Lightning page components:
User-added image

It's my understanding that the code provided in the exercise is supposed to recreate the Lightning look and feel, yes?
Jon ManloveJon Manlove
It is certainly possible that the instructions in the exercise are outdated and non-functional.