+ Start a Discussion

Salesforce1 app lookup field on visualforce page not working

Hello there!

I've created a VF page to create an Opportunity record. I've added this VF page as publisher action on the Account Object.
This VF page is working properly on the browser. However, in the Salesforce1 app the lookup functionality is not working.
The lookup icon is available but after clicking on that icon it opens the lookup page in browser mode and if I select any record on the pop up It takes me directly to that record instead of populating that value in the lookup field.

We have some other publisher actions like creating the Task record where we are not using a VF page. for such standard actions the lookup functionality is working as expected.

Has anyone encountered similar issue? if yes, how to resolve this issue?

Hey Rahul,

Just came across the following and am wondering if its the reason for the issue you are facing:

Visualforce Pages
Standard tabs, custom object tabs, and list views that are overridden with a Visualforce page aren’t supported in Salesforce1. The Visualforce page is shown for full site users but Salesforce1 users will see the default Salesforce1 page for the object instead. This restriction exists to maintain the Salesforce1 experience for objects.
Thanks for the reply Sonam!

However, in my case I've not overridden any Object/Tabs. I've added this VF page as a publisher action. 
This VF page works fine on the WEB browser. I access it from the chatter panel pn the Account detail page.

When I access this page from the browser it open as new popup window after clicking on the lookup field.
The same thing is happening on the Salesforce1 app as well. But the problem here is it opens that pop up window in browser mode.
and after selecting a record from that pop up window its going directly to that selected record instead of populating that records as a lookup value.

Does lookup field functionality works on the VF page accessed from the salesforce1 app?

I'm finding this issue exists under the Salesforce1 app and in a Mobile SDK hybrid app as well. I have not yet found a solution to this. If/when Salesforce resolves this, I suspect I'm going to have to code my own lookup dialog.
Regarding, 'rolling your own', I found Bob Buzzard blogged a really useful example back in 2010:
Harpreet On CloudHarpreet On Cloud
One of my friends was able to find a solution to the same problem - Set standardStylesheets="true" in apex:page tag. See if it solves yours too.