You need to sign in to do that
Don't have an account?
Suresh_SFDC
How to hide/show Cutom button on opportunity detail page
Hi,
I have a requirement like hide/show custom button based on opportunity stagename.
1) Opportunity stagename is "Closed won" i want to enable cutom button while clicking this button it will redirect to vf page.
2)Not "Closed Won" hide the custom button like stand functionality
Any one suggest using on click java script
I have a requirement like hide/show custom button based on opportunity stagename.
1) Opportunity stagename is "Closed won" i want to enable cutom button while clicking this button it will redirect to vf page.
2)Not "Closed Won" hide the custom button like stand functionality
Any one suggest using on click java script
you can not hide the javascript button on the fly on standard page.
these are only possible solutions
1) go for record type approach but that will happen at the time of record save
2) keep some validations inside custom buttons and throw some error or warning message when user clicks on that button (if criteria is not matching or user is not authorized)
if you want this happen on the fly then you need to go for VF page where you can use <apex:detail and hide the buttons as required i guess.
One place i have seen possible is
http://salesforce.stackexchange.com/questions/72111/can-i-hide-a-custom-button-on-standard-page-based-on-some-field-value
but this also we can keep button as a field but not in the place of buttons sections
take a call as per your requirement
let me know, if it helps you or need any help
shiva.sfdc.backup@gmail.com
All Answers
follow the below steps...
step 1)
Create two recordtypes of ur object,names like DisableButton ,EnableButton
for EnableButton,assign ur button to pagelayout
for DisableButton,dont assign button to pagelayout
step 2)
write a trigger like below
you can also replace step 2 with workflows..
Is it possible to use on click java script in custom button?
you can not hide the javascript button on the fly on standard page.
these are only possible solutions
1) go for record type approach but that will happen at the time of record save
2) keep some validations inside custom buttons and throw some error or warning message when user clicks on that button (if criteria is not matching or user is not authorized)
if you want this happen on the fly then you need to go for VF page where you can use <apex:detail and hide the buttons as required i guess.
One place i have seen possible is
http://salesforce.stackexchange.com/questions/72111/can-i-hide-a-custom-button-on-standard-page-based-on-some-field-value
but this also we can keep button as a field but not in the place of buttons sections
take a call as per your requirement
let me know, if it helps you or need any help
shiva.sfdc.backup@gmail.com
Thanks ShivaKrishna, in my org there is no record types to do the first approach.
I will try the second option
Thanks for quick update :)