Hiding Panels in System Screens in Sage CRM

1 minute read time.

Screens like the Opportunity Summary, Case Summary and Company Summary page are divided into different panels. Much of the page layout in the current version is controlled by HTML Tables.

CSS styles are used to format the display of the tables and their TD tags. In these summary pages the different panels are separated by TD that have the class 'ROWGap'.

We can take advantage of the this fact to allow us to control the page by either adding or removing panels.

I discussed adding a panel in the article "Adding a new Panel to a Summary screen e.g. Company Summary".

The same trick can be used to find panels to hide them.

For example you may want to hide the Opportunity Total panel in the Opportunity Summary Screen.

In the sample code below I have mixed Sage CRM Client Side code with Plain Old Javascript.

I have used the crm.ready() method to make sure that the code will load and run in all supported browsers as the page loads and I have used the crm.getTrans() method to make sure that the code hides the panel whatever the users language.

[code language="javascript"]

//get the current cells parent's parent and remove the child
//this removes the "RowGap" row
strTargetTD = arrTDs[i].parentNode;
strTargetParent = strTargetTD.parentNode;
strTargetParent.removeChild(strTargetTD);

//get the current cells once the 'RowGap' has gone and delete the panel.
strTargetTD = arrTDs[i].parentNode;
strTargetParent = strTargetTD.parentNode;
strTargetParent.removeChild(strTargetTD);

}
}
}

})

[/code]

  • Jeff:

    Does this method actually "remove" the panel or just "hide" it. Based on the title of the post, it appears to just "hide" it. Is it possible to actually remove it?

    We have a client that is using Sage CRM for two distinctly different areas of their business and they are using the user's primary territory to control this. The Opportunity Detail Screen has all the fields related to one of these territories and none of the fields will be used for the other territory, except the description. Therefore, we want to remove the details panel depending on the territory.

    We have an issue when we are converting from a Lead to an Opportunity. I have been able to successfully "hide" the details panel (Although it appears to flash briefly on the screen). However, whenever we try to hit "save" when converting from the Lead to Opportunity, we get a validation errors message.

    If a field has been marked as required at the field level, we have made sure it is addressed on the WebPicker.

    Is the system still addressing required fields at the screen level for fields that are on the detail screen even thought it has been hidden?

    If so, is it possible to actually remove the panel rather than just hide it?

    Any assistance you can provide will be greatly appreciated. Thanks!

  • Jeff...

    I figure this out. The "theory" of what I was trying to do here worked. The problem is that the param I was using no longer existed once the template was loaded (I used the param to load the template). Therefore, I used this instead...

    var TempId = $('#template').val();

    if(TempId === "1012")

    My template is 1012...so the box does not appear.

    Awesome!

  • It appears that I do need to ask one question in regards to this. This does work to hide the Communications Options. Yeah!

    However, it hides it on ALL the new email buttons throughout the system. Boo!

    Since I put a custom parameter in my button, I thought I could use that parameter to hide the box if my parameter condition was met. However, it is not working. Therefore, I am wondering if I did not understand what I might be able to do with that custom parameter or if I simply have an error in my code that I need to look more closely for.

    This is how I added my button...

    var strCHSEmailLeaseButton = CRM.Button("CHS Email Lease","NewEmail.gif",CRM.URL("1500") + "&Lease=Y");

    I added it to my block with this....

    AddButton(strCHSEmailLeaseButton);

    I added your above example to the custom content box of my screen (modified). As I indicated, it works...but it does it for ALL the email screens.

    Therefore, I tried wrapping the example code as follows...but it is not working. (Note: I did use the custom param previously in the custom content for another purpose...but thought I could use it again for this. Maybe not?)

    Can you tell me if this should work in custom content? Thank you!!

    function HideEmailFilingBox ()

    {

    var myparam = crm.getArg("Lease", crm.url());

    if(myparam === "Y")

    {

    the code above modified accordingly (the above code works before I add the custom param)

    }

    }

    crm.ready(function()

    {

    HideEmailFilingBox();

    });

    Any assistance is greatly appreciated!!

  • Thank you for the post Jeff!

    I was able to use this to hide the Communications Option box on the email screen! :-) I know it may be strange to want to hide it that box..but the details from this box are being passed in some custom code associated with the Email Screen...so I don't want to show it because I think it is confusing to the user. I might be doing cartwheels soon!