I am in need of help for structuring my datas. I am trying to create an CRM app.
The app has data types of Product and Company with their respective data fields under them.
My challenge is, I have 50 different products and 100 different companies. Some companies produce a certain product up to 100mm thickness and some produce up to 200mm. So I need to store this size limitation data within the data base. And when the user receives a demand for this product for 150mm, user should be able to search for the companies that can produce this product with that size?
If you can kindly advise me a data structure for this I will really appreciate that.
Defining a database structure is a bit difficult with just that information, but you will probably want to set up a data type that connects the 1) Product (type product), 2) Company (type Company) and size range they can produce (numerical range).
So, something like:
Data type: Product size offer Company: Custom data type: Company (e.g. Acme) Product: Custom data type: Product (e.g. “Fan blade”) Thickness: Numerical range (.e.g [100,200 – giving a range of 100-200)
This way, you can filter the search by product, and then by the desired thickness (number). If it it falls within the Thickness numerical range, you’ll get a result.
if you need to return a list of companies to the user then you’d be best to store the data on the company (option set list of sizes, or a max size number field) - update the field whenever a new product is added or a product is changed for the company.
then user could search for companies where size is up to 200mm.
if you need to return a list of products then you can just store the data on the product.
then user could search for products where size is up to 200mm and then see the company name/card for each product row. You could also add a filter for company for the user.