+ Start a Discussion
Rohit TripathiRohit Tripathi 

Getting ID of a Custom Button

Hi Everyone,

I am adding a custom button on standard detail page. When user clicks on this custom button, javascript code is executed and if condition is met, a new tab opens up with data from another object. When condition is not met, it is currently coded to diplay standard javascript alert window. I want to disable the custom button on Standard detail page if condition is not met. I am ok if button is disabled after user clicks on button once. I am trying to achieve this by using document.getElementById("Id of Button") method but I am not able to find out what should be the Id of custom button. 

If there is some other way to achieve this then I would like to know, otherwise if there is a way to get Id of custom button then I can try to implement it using document.getElementById("Id of Button") method. 
As per my understanding, Hide/Show/Disabling of buttons is not supported on standard salesforce pages as of today.