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
Suma GangaSuma Ganga 

Hide Related List

Hi,

I have used below code to hide the related list.
//This code finds our "Notes and Attachments" related list, and hides it completely:
      var el = document.getElementsByTagName('*');
      for(var i=0;i<el.length;i++){
        if(el[i].id.match('_RelatedNoteList')){ //This finds our related list.
                          //Salesforce appends the record Id to the html name,
                          //so this finds a match disregarding the record Id.
          //We need to toggle both visibility and display for support across various browser types
          el[i].style.visibility="hidden";    //hide visibility
          el[i].style.display="none"; //hide display.
        }
      }


But, i am not able to get ID's or Class name's from right side pane to left nav. pane..
i have created Visualforce page in left nav from homepage component.

please tell me the alternative way to get ID 's from right pane to left pane...

Thank you in advance!!

-- Suma.
Best Answer chosen by Suma Ganga
Suma GangaSuma Ganga
this will get solved by using custom links instead of html area...

thanks.. :-)

All Answers

Fabien TaillonFabien Taillon
Why aren't you removing the related list from the Page Layout ?
Suma GangaSuma Ganga
Hi Fab,

Thank you for Replying....


my requirement is like, on conditional basis i have to hide the particular related list.

For example:  assume there is an checkbox in my page.. if i checks that check box i have to hide the related list, otherwise i have to show the relatedlist...



Thanks in Advance!..



-- Suma.
Fabien TaillonFabien Taillon
Do you have lots of rules ? I guess the best practice would be to use 2 differents record types with 2 page layouts, and change record type with a workflow when you conditions are matched.
Suma GangaSuma Ganga

HI Fab,


Thank you for Replying...


can we have different  page layouts for different role in same profile...


Thnaks,

--suma.

Fabien TaillonFabien Taillon
No, if you want 2 users to have a different Page Layout, you need them to have 2 different profiles.
Suma GangaSuma Ganga
this will get solved by using custom links instead of html area...

thanks.. :-)
This was selected as the best answer