function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Dhanesh SubramanianDhanesh Subramanian 

I have a Sturdy(Custom Object) related list under Standard Account object, i do want to make the New button of the Sturdy related list to be displayed only if the Account status is Active?

I have a Sturdy(Custom Object) related list under standard Account object, i do want to make the New button of the Sturdy related list to be displayed only if the Account status is Active?
bob_buzzardbob_buzzard
You can't do this I'm afraid - you can't conditionally display related lists or buttons on related lists etc. They either appear or don't. The options that you have are:

- replace the related list with a Visualforce approximation.  
- create a custom new button that hits an interim VF page to check if the account is active
- create a custom new button that executes JavaScript to check if the account is active

None of them are great options though.
saikishorecareer3341.3947811933764766E12saikishorecareer3341.3947811933764766E12
You can do in this way..

Create two page layouts with new button enabled in one layout and not enabled on other..Write a workflow rule which checks the active field of account and based on the result update the recordtype id with required layout.

This will realy solves your issue.