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
dymx1021.3897562878694583E12dymx1021.3897562878694583E12 

How to get the account 'id' and 'name' from an account landing page on SF1 Mobile?

Hi All,

I'm new to SF development, and I'm trying to enable my app to the SF1 mobile app...
Actually, I want to write a Visualforce page for a custom action on SF1 Mobile, and here is my question:

How can I get the account 'id' and 'name' for my VF page to use on an account landing page?


Here is my use case in detail:
1. When a user entered an Account landing page, and tapped the "+" button on the right-bottom corner, it will show a Publisher panel;
2. I want to add a custom action on the Publisher panel, when the user tapped the action, it shows up a VF page;
3. The VF page will use the account name to lauch a search, the results will be a company list, and the user may connect the account to a specific company with account id;
4. the user can get some useful data from a third party web service using the account id.

I just don't know how to get the id and the name...Could someone please help me?

Thanks a million!
-Daniel

bob_buzzardbob_buzzard
When you add a custom publisher action to an sobject, it will only allow you to select pages that use the standard controller for that sobject.  You can then write an extension controller that gets the id of the record from the standard controller.  To get the name there are a few choices, but the easiest is to have an unrendered output field for the account name in the page, as that will force the standard controller to retrieve the field for your use.  

Ray Dehler explained this technique at:

http://raydehler.com/cloud/clod/best-practice-related-fields-with-standard-controller-extensions.html
dymx1021.3897562878694583E12dymx1021.3897562878694583E12
Thank you for your quick reply, Bob!

I understood your suggestion and will have a try...

BTW, another question...I've wrote a custom widget on my web server, I want to embeded it in a VF page using iFrame technique, my question is can I make a custom publisher action using such a VF page? will the widget show up correctly?

Many thanks.
-Daniel
bob_buzzardbob_buzzard
My experience is that the iframe will show up correctly, but you won't be able to interact the with the publisher buttons from there (i.e. enabling the submit button or closing the dialog).