6

I am getting the following error in my visualforce page available for mobile, where using the sforce variable :

Uncaught ReferenceError: sforce is not defined

Prior to the winter 16 release everything were working fine. On my iphone the code works, but it is no more working when accessing the page in my browser on my desktop. I suspect that it's because i didn't activated the new salesforce1 interfaces (lightning experience). Because i'm not using one/one.app either because of this limitation impose by salesforce. But i need to access my page via desktop on my browser for javascript debuging purposes. How can i get to use the sforce variables wihtout activating lightning experience for my user ?

6

Switching agent of your browser can easily load the emulator (remember don't need to enable Lightning for this, neither sharing rule), you can change browser agent in chrome/safari manually, or simply use agent-switch plugin to change agent to mobile

Agent Switch: (https://chrome.google.com/webstore/detail/user-agent-switcher-for-c/djflhoibgkdhkhhcedjiklpkjnoahfmg?hl=en-US)

and using this URL (enter your domain): DOMAIN.lightning.force.com/one/one.app

reference: http://www.oyecode.com/2015/10/winter-16-fix-salesforce1-oneoneapp.html

| improve this answer | |
5

The one/one app is no longer available for Salesforce1 as of Winter16. See the Release Notes. You'll need to use an emulator as discussed in the notes. In my experience, you can typically use Chrome in mobile mode device emulation mode for most of your needs, but I've not used it recently to see if it's still working for non-lightning pages.

| improve this answer | |
5

I found a very nice tool that replaces the one/one.app to test for mobile visualforce page on the web. It is actually a plugin on chrome web store name salesforce1 simulator. From there it works like a charm. But i can't debug the code if the js crashes. Then i do as suggested, using an emulator on my chrome browser, then i launched the one/one.app (no lightning in the url) and inspect using the chrome inspect element.

| improve this answer | |
0

Try Adding references to JS files

{!REQUIRESCRIPT("/soap/ajax/34.0/connection.js")} {!REQUIRESCRIPT("/soap/ajax/34.0/apex.js")}

Worked for me

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.