locked
Hiding sub-contacts from contacts form RRS feed

  • Question

  • I'm trying to hide sub-contacts on the left nav panel from the contacts form.
    I was able to hide sub-accounts at runtime by using the following code

    if(document.all.navSubAct != null) 

    { 

        navSubAct.style.display = 'none'; 

    }

    i think i found this on Jim's post the other day, and this was very sleak.

    I tried navSubContacts to hide sub-contacts, and it kept giving me error message.

    I also tried adding document.getElementById("navSubContacts").style.display = "none"; and tried to play around with quotations and it didn't work

    Any ideas?

    • Edited by SPCRMCnst Thursday, May 14, 2009 7:20 PM
    Thursday, May 14, 2009 7:18 PM

Answers

  • Hi, Jacob.

    You can find id of section to hide. To do this proceed following steps:
    1. Open form of existing contact.
    2. Press Ctrl + N - this will open new form with toolbars.
    3. Open View - Source.
    4. In appeared window find the Reuired text with Ctrl-F. Mark Id of the node which contains searched text.
    5. Write script using fount id to hide section.
    Truth opens to prepared mind. My blog - http://a33ik.blogspot.com
    Thursday, May 14, 2009 7:36 PM
    Moderator
  • Jacob,

    You can find the ID by using the IE Developer Toolbar, in your case, the code should be:

    if(document.getElementById("navSubConts") != null)
    {
      document.getElementById("navSubConts").style.display = "none";
    }
    Hope it helps!

    Cheers,
    Jim

    Jim Wang - MVP Dynamics CRM - http://jianwang.blogspot.com , http://mscrm.cn
    Thursday, May 14, 2009 7:45 PM
    Moderator

All replies

  • Hi, Jacob.

    You can find id of section to hide. To do this proceed following steps:
    1. Open form of existing contact.
    2. Press Ctrl + N - this will open new form with toolbars.
    3. Open View - Source.
    4. In appeared window find the Reuired text with Ctrl-F. Mark Id of the node which contains searched text.
    5. Write script using fount id to hide section.
    Truth opens to prepared mind. My blog - http://a33ik.blogspot.com
    Thursday, May 14, 2009 7:36 PM
    Moderator
  • Jacob,

    You can find the ID by using the IE Developer Toolbar, in your case, the code should be:

    if(document.getElementById("navSubConts") != null)
    {
      document.getElementById("navSubConts").style.display = "none";
    }
    Hope it helps!

    Cheers,
    Jim

    Jim Wang - MVP Dynamics CRM - http://jianwang.blogspot.com , http://mscrm.cn
    Thursday, May 14, 2009 7:45 PM
    Moderator
  • thanks a lot Jim.
    I thought i tried both navSubConts and navSubContacts. I must have missed something. haha
    Friday, May 15, 2009 2:23 PM