I want to extend SuiteCRM’s AOS_Products module. I want to have the ability to define more data for specific categories of items. The usual way to do this would be to define some custom fields in the AOS_Products module and be done.
However, I want to be more efficient with the implementation. Take this example:
There are 3 different AOS_Product_Categories defined.
Cat1, Cat2, and Cat3.
When ProductA is set to be in the Cat1 product category, I want to have 24 unique values/fields associated with this product.
When ProductB is set to be in the Cat2 product category, I want to have 50 unique and different values/fields associated with this product.
When ProductC is set to be in the Cat3 product category, I want to have 12 unique and different values/fields associated with this product.
The unique fields per category are all different and therefore not shared. So my option now is to add 86 custom fields (24+50+12) to the AOS_products table.
What I want to do instead is to add 3 tables:
AOS_Products_Cat1 table with a product_id field and the 24 unique values/fields
AOS_Products_Cat2 table with a product_id field and the 50 unique values/fields
AOS_Products_Cat3 table with a product_id field and the 12 unique values/fields
I understand I would have to add custom logic and javascript to the EditView, DetailView, and controller of the AOS_Products module.
What I don’t know is how to define these new tables in the metadata of SuiteCRM so that a Quick Repair/Rebuild will know about the tables and prompt with a create SQL. If defined in the metadata any future changes to the table can just be made in the metadata followed by a Quick Repair/Rebuild to extend the tables.
Or…do I have to just manually create these tables and NOT define them in the metadata?