Creating new relationships with the Product Categories module - has anyone done this?

Hi!

We have a requirement to create a relationship between the Product Categories module and a 'module-builder module'.

Unfortunately, this module is not visible in Studio.


Do you think the best approach would be to try and enable this to be visible in Studio and try to create a relationship from there?
Or just try to create a custom code relationship?

Thanks! James.

Parents
  • Hi James,

    If I understand your question correctly, you want to create a relationship between the Product Categories module and custom module in Sugar.

    As few modules like Manufacturers, Product Categories, etc are hidden in studio by default we don't see them in the Studio to do any modifications like adding new custom fields or custom relationships. I suggest you to bring this module to studio through a simple method instead of creating relationship through code.

    If you add an empty studio.php (with just php tags open and close) file in below path you can see the Product Categories module in Studio and then you can add relationship easily.

    custom/modules/ProductCategories/metadata/studio.php

    Once the file is in place give repair and rebuild and now you can see the Product Categories module in studio.

    Please do this first on your development instance and test it.

    Hope this information helps you:)

    Thanks and Regards,

    PK,

    www.bhea.com

Reply
  • Hi James,

    If I understand your question correctly, you want to create a relationship between the Product Categories module and custom module in Sugar.

    As few modules like Manufacturers, Product Categories, etc are hidden in studio by default we don't see them in the Studio to do any modifications like adding new custom fields or custom relationships. I suggest you to bring this module to studio through a simple method instead of creating relationship through code.

    If you add an empty studio.php (with just php tags open and close) file in below path you can see the Product Categories module in Studio and then you can add relationship easily.

    custom/modules/ProductCategories/metadata/studio.php

    Once the file is in place give repair and rebuild and now you can see the Product Categories module in studio.

    Please do this first on your development instance and test it.

    Hope this information helps you:)

    Thanks and Regards,

    PK,

    www.bhea.com

Children
  • Hi PK, 

    Thanks for the tip! Very useful.
    We did actually create this file last week and was then able to see this module in Studio.
    We were also able to create the relationship in Studio between the custom (module builder) module and Categories. 

    The only trouble was that it didn't produce a sub-panel on the Categories side (1-many) so we think we're going to also implement this via code.

    Thanks for your inputs.

    JB