• _Vish_
  • NEWBIE
  • 0 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies
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:
    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 button
NOTE:  {!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