removing a default relationship

Hi there,

I wanted to have the option of linking opportunities to contacts via a one-to-many relationship, contacts (primary module) and opportunities (related module). That works fine, but the issue I’ve got is there was already a relationship between opportunities and contacts (many-to-many), and so now in a contact record I have two separate opportunities sub panels.

I thought I’d just be able to delete the many-to-many relationship in studio but there’s no option to. How can I remove this relationship, or hide the specific sub panel that relates to it.

many thanks

You can try this “unset” technique to hide the subpanel you don’t want

https://community.sugarcrm.com/thread/20746

1 Like

Brill, this one worked;

Try to create on “/custom/Extension/modules//Ext/Layoutdefs/” directory a php file called “layoutdefs.ext.php” and include following line:

unset($layout_defs['<current_module>']['subpanel_setup']['<module_you_want_to_hide']);
1 Like

Scratch that, it was working for version 7.9.8, but I’ve since upgrade to 7.10 and now that no longer seems to work.

Anyone got any ideas why or what might have happened?

Is your customization still there? I don’t think that directory gets overwritten on a Quick Repair and Rebuild, but I am not sure.

This might help you see what’s going on:

https://pgorod.github.io/Audit-File-Accesses/