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
Sfdc wonderSfdc wonder 

How to Enable OnClick JavaScript Buttons in Salesforce1 platform

Hi,
i developed one Detail Page Button through OnClick JavaScript in Lead.when i click this button the Lead can be synced with 3rd party.For this i have to call web service Class(usin Http callouts) from this JavaScript Button.every thing working fine but the button i have to created using OnClick JavaScript is not display in Salesforce1 platform.
Please any one suggest me how to enable OnClick JavaScript Buttons in Salesforce1 platform.
Best Answer chosen by Sfdc wonder
ShashForceShashForce
Hi,

Here's the thing. Custom buttons with OnClick Javascript will not be available in Salesforce1, and it is expected functionallity.

However, as a workaround, you can move your javascript into a visualforce page and use this visualforce page for the custom button. This way, the custom button will be available in Salesforce1 provided that the visualforce page has "Available for Salesforce mobile apps" option enabled. You can also use a publisher action instead of a custom button for the saem visualforce, which is a more preferred way on the Salesforce1 platform.

If this answers your question, please mark this as the Best Answer for this post, so that others can benefit from this post.

Thanks,
Shashank

All Answers

ShashForceShashForce
Hi,

Here's the thing. Custom buttons with OnClick Javascript will not be available in Salesforce1, and it is expected functionallity.

However, as a workaround, you can move your javascript into a visualforce page and use this visualforce page for the custom button. This way, the custom button will be available in Salesforce1 provided that the visualforce page has "Available for Salesforce mobile apps" option enabled. You can also use a publisher action instead of a custom button for the saem visualforce, which is a more preferred way on the Salesforce1 platform.

If this answers your question, please mark this as the Best Answer for this post, so that others can benefit from this post.

Thanks,
Shashank
This was selected as the best answer
Sfdc wonderSfdc wonder
Hi Shashank_SFDC,

Thanks for your reply,

Can i integrated to third party from Visualforce page??

How can i achieve same functionality using Visualforce Page.Give me any idea.

i need to display messages like successfully synced with 3rd party or the Lead already existed based on some field in Lead.
ShashForceShashForce
Hi,

You can include javascript within visualforce. Please check out these links:

https://www.salesforce.com/us/developer/docs/pages/Content/pages_javascript_intro.htm
http://salesforceworld.blogspot.in/2011/06/javascript-with-visualforce-pages.html
http://www.youtube.com/watch?v=eiuiDjYih18

Thanks,
Shashank