You need to sign in to do that
Don't have an account?
Recreate buttons from "Execute JavaScript" to Visualforce
To anyone who can point me in the right direction. I have done a lot of research, but can't seem to find the correct solution to my issue.
I need to take two buttons that we have created on Salesforce Classic, using the behavior Execute JavaScript, and recreate them using Visualforce. Our issue is that the buttons show up on our computers, but it not available through the mobile app.
These are the two buttons we currently have,


Can anyone offer guidance on where to go. I am aware I need to create a controller/apex class, but this is a little out of my knowledge base and I would like to learn how to go about recreating these buttons so they function online and on mobile.
Thanks,
Katrina Harsh
I need to take two buttons that we have created on Salesforce Classic, using the behavior Execute JavaScript, and recreate them using Visualforce. Our issue is that the buttons show up on our computers, but it not available through the mobile app.
These are the two buttons we currently have,
Can anyone offer guidance on where to go. I am aware I need to create a controller/apex class, but this is a little out of my knowledge base and I would like to learn how to go about recreating these buttons so they function online and on mobile.
Thanks,
Katrina Harsh
Then you have a choice. You can use the Custom Button approach that will be available in both Classic and Salesforce1 / Lightning Experience but you cannot set the icon for this. To do that you just goto Setup ⇨ Customize ⇨ Leads ⇨ Buttons, Links, and Actions ⇨ New Button or Link and fill out the following
Your other option is to add it as a Visualforce page action. This will only be available in Salesforce1 / Lightning Experience but you can customize the icon.
Then once you have your action / button created you add it to the Salesforce1 and Lightning Experience Actions section of the page layout
If you want it for classic you'd also add your Custom Button there.
Then you're good to go and you'll see it in Salesforce1
You can also do both a button for classic and an action for Salesforce1 but it's a little tough to tell them apart (without trial and error) if you give them the same label.
All Answers
AcceptLead.cls
AcceptLead.vfp
RejectLead.cls RejectLead.vfp
You will need to update line 13 of RejectLead.cls to set your owner id and uncomment the line. Then you just create Visualforce buttons for each of these and add it to your page layout.
PCon,
Thank you for the help, but how do I go about setting these actions up on the mobile app?
I have the coding added to our org, and they work well as buttons on the desktop, but when I go into the mobile app they don't even appear. How can I go about changing that?
Thanks,
Katrina
Then you have a choice. You can use the Custom Button approach that will be available in both Classic and Salesforce1 / Lightning Experience but you cannot set the icon for this. To do that you just goto Setup ⇨ Customize ⇨ Leads ⇨ Buttons, Links, and Actions ⇨ New Button or Link and fill out the following
Your other option is to add it as a Visualforce page action. This will only be available in Salesforce1 / Lightning Experience but you can customize the icon.
Then once you have your action / button created you add it to the Salesforce1 and Lightning Experience Actions section of the page layout
If you want it for classic you'd also add your Custom Button there.
Then you're good to go and you'll see it in Salesforce1
You can also do both a button for classic and an action for Salesforce1 but it's a little tough to tell them apart (without trial and error) if you give them the same label.
PCon,
Thank you so much for the help! It works! Now I know how to translate Java codes for future!
Thanks again,
Katrina Harsh