You need to sign in to do that
Don't have an account?
Thomas Fuller
Can you create a custom button with javascript that is able to change the label of the button?
Hey,
I'm in the process of developing a custom button on Salesforce that is able to toggle a checkbox on and off.
At this point, I am using the Salesforce AJAX Toolkit in order to do the main backend functions of the custom button.
I have the backend working, but I was hoping I could have the custom button label toggle between "Start Process" and "End Process".
To do this, I assume I would need the custom button to change it's own label.
I attempted this by placing these lines in my code:
It's also entirely possible that I cannot change the name of the button with the AJAX Toolkit.
I am very new to Salesforce and learning about this tool, so any ideas or suggestions will be greatly appreciated!
Thanks,
TF
I'm in the process of developing a custom button on Salesforce that is able to toggle a checkbox on and off.
At this point, I am using the Salesforce AJAX Toolkit in order to do the main backend functions of the custom button.
I have the backend working, but I was hoping I could have the custom button label toggle between "Start Process" and "End Process".
To do this, I assume I would need the custom button to change it's own label.
I attempted this by placing these lines in my code:
var toggleButton = new sforce.SObject("Lead"); var toggleButtonT ="{!Lead.Begin_Touch_Process}"; //my attempt to reference the button toggleButtonT.Id = "00bc0000000QoaE"; // my attempt to reference the button id toggleButtonT.Label = "test"; // entering new value for the button label result = sforce.connection.update([toggleButton]); // updating the buttonNOTE: {!RequireScript} is already mentioned in script.
It's also entirely possible that I cannot change the name of the button with the AJAX Toolkit.
I am very new to Salesforce and learning about this tool, so any ideas or suggestions will be greatly appreciated!
Thanks,
TF
Then dispaly the same button in Visualforce page based on value of checkbox with different name.
Example:
<apex:commandButton value="Start Process" action="youfunction" rendered="{!(yourcheckbox=false)}"/>
<apex:commandButton value="End Process " action="youfunction" rendered="{!(yourcheckbox=true)}"/>
All Answers
The below article shows how to dyncamically show button on visualforce page
http://www.interactiveties.com/b_visualforce_dynamic_buttons.php#.U43j8vlmOo0
Then dispaly the same button in Visualforce page based on value of checkbox with different name.
Example:
<apex:commandButton value="Start Process" action="youfunction" rendered="{!(yourcheckbox=false)}"/>
<apex:commandButton value="End Process " action="youfunction" rendered="{!(yourcheckbox=true)}"/>
Hi Thomas,
Just wondering if you ended up finding your ideal solution?
And whether it was possible with a custom JavaScript button (without using a custom visualforce page)?
I'm trying to solve the same problem, any insight would be much appreciated.