I have a Custom Object called 'CustomObj' which will only be created from another object. I have a Visualforce page where I am redirecting the user when they click CustomObjs tab and I am displaying the following list:

<apex:page action="/a0a/o?nooverride=1')" tabstyle="CustomObj__c">
    <apex:enhancedList type="CustomObj__c" height="800" customizable="true"/> 
</apex:page>

However, the page still shows the 'New' button is still there.

enter image description here

Is there any way to use JavaScript to remove or hide it from the layout?

  • You could try the Search Layouts section of your custom object and edit the List View entry to remove the New button, but of course that will apply to the standard UI as well. – David Cheng Dec 12 '17 at 20:20
  • In my CustomObj List View the New button is unchecked, but it still shows up in the initial tab page from my screenshot. @DavidCheng – FlameDra Dec 12 '17 at 20:33
  • maybe this is useful - salesforce.stackexchange.com/questions/1308/… – Bharat Dec 13 '17 at 0:08
  • @Bharat I have tried that and the JS does not work on the page, the New button is still there. – FlameDra Dec 13 '17 at 15:13

Your Answer

 
discard

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.