Convert CRM Horizontal Tabs into a Dropdown Menu

When you start adding many custom entities to CRM, the standard CRM horizontal tabs can become very cluttered.

A need arose to group tabs into a dropdown menu.

Attached is a js script that rebuilds the CRM horizontal tabs and replaces it with a custom drop down menu. The dropdowns can be edited by changing the createNewMenuArray() script.

No security/permissions are bypassed. All tab SQL work.

Place the script into the WWWRoot/js/custom folder and rename it to have the '.js' extension and not '.txt'.

Tested on Sage CRM 2017 R2.

/*************************************** Change CRM horizontal tabs into dropdown menus ******************************************************
*
* 1. Add a tab by pushing the tab to the 'menusArray' in line 15. =>
* 2. The first element is Always the Tab Name
* 3. The second, third, forth, etc. elements are the tabs in the dropdown.
* 4. These have to be spelled exactly like they are in CRM.
* 5. If a tab exist in CRM but not in one of these arrays then it will appear on the end of the horizontal tabs ribbon.
* 6. If a tab exists here but not in CRM then it will not show at all.
* 7. If there is an error in this code, the whole custom tabs dropdown will fail and the default CRM horizontal tabs will show.
* 8. If the Tab Name exists in the CRM horizontal tabs, then it will also be a 'button'.
* 9. After changing this file, save it, then refresh the metadata: Select 'Refresh System Parameters' in CRM (Administration -> System -> Metadata)
* e.g. Preferences
*/
function createNewMenuArray()
{
var menusArray = [];
menusArray.push(["Standard CRM1","Leads","Opportunities"]);
menusArray.push(["Cases","Cases Overdue","Custom Cases Entity"]);
menusArray.push(["Maintenance","Projects","Solutions", "Preferences"]);

// e.g. add new tab : note, these are not appearing as no tab named 'Item 1','Item 2','Item 3' exist.
menusArray.push(["Tab Name1","Item 1"]);
menusArray.push(["Tab Name2","Item 1", "Item 2"]);
menusArray.push(["Tab Name3","Item 1", "Item 2", "Item 3"]);
menusArray.push(["Tab Na...","Item 1", "Item 2", "Item 3", "Item ..."]);
return menusArray;
}