Hi all,
i’m creating a custom module named ‘asset’.
In the account module and in the product module I created a one-to-many relationship with asset,
In the asset create/edit view when the user selects the product, I need to autofill a field named Product Category with the product category associated with the selected product. How can I achieve this goal? The problem is that I don’t have a direct relationship between asset and product category, I must pass through the product entity.
Trying to avoid the previous problem, at this moment I’ve tried to substitute the Product Category field with a Product Category ID field autofilled when the product is selected using the db field aos_product_category_id in the aos_products table.
In suitecrm/custom/extension/modules/s0001_Asset/ext/vardefs I created a new vardef.ext.php file with this code lines:
$dictionary['s0001_Asset']['fields']['aos_products_s0001_asset_1_name']['populate_list'] = array('name', 'id', 'aos_product_category_id');
$dictionary['s0001_Asset']['fields']['aos_products_s0001_asset_1_name']['field_list'] = array('aos_product_name', 'aos_product_id_c', 'productcategoryid_c');
When the user selects a Product, the page autofill the Product Category ID field with the right product category id, but if I try to save my asset, I receive the error: “No match for field: Products”
I attach the image with the error:
There’s a way to get the Product Category Name in my asset create/edit page? If no, how can I resolve the “No match for field: Products” error?
Thank you in advance