Copying custom fields from a Product Catalog Entry to a new Quote Line Item

Hello...

In Sugar 7.9.x:

Does anyone know how we get new custom fields in the Product Catalog (Product Template) module automatically copied over as default values for the line items in the Quotes module?

Out of the box it does this for some fields (e.g., Description and Product Code) but not all of them and not new fields we add to the system.

In the core Sugar Products.php module (modules/Products/Product.php) there is the default field list in the $template_fields array.

Is there a good way to extend this list in an upgrade-safe and OnDemand acceptable way?


Thanks
Russell

Parents
  • I am not sure how to do this OnDemand but if you had access to the code you could extend the Products vardefs:

    custom/Extension/modules/Products/Ext/Vardefs/<your_preferred_filename>.php

     

    $dictionary['Product']['fields']['product_template_name']['populate_list'] = array(

                    'name' => 'name',

                    'category_id' => 'category_id',

                    'category_name' => 'category_name',

                    'mft_part_num' => 'mft_part_num',

                    'list_price' => 'list_price',

                    'cost_price' => 'cost_price',

                    'discount_price' => 'discount_price',

                    'list_usdollar' => 'list_usdollar',

                    'cost_usdollar' => 'cost_usdollar',

                    'discount_usdollar' => 'discount_usdollar',

                    'tax_class' => 'tax_class',

                    'weight' => 'weight',

                    'type_id' => 'type_id',

                    'type_name' => 'type_name',

                    'manufacturer_id' => 'manufacturer_id',

                    'manufacturer_name' => 'manufacturer_name',

                    'currency_id' => 'currency_id',

                    'base_rate' => 'base_rate',

                    'your_custom_product_field_c' => 'your_custom_catalog_field_c',

                    );

     

    HTH

    FrancescaS

Reply
  • I am not sure how to do this OnDemand but if you had access to the code you could extend the Products vardefs:

    custom/Extension/modules/Products/Ext/Vardefs/<your_preferred_filename>.php

     

    $dictionary['Product']['fields']['product_template_name']['populate_list'] = array(

                    'name' => 'name',

                    'category_id' => 'category_id',

                    'category_name' => 'category_name',

                    'mft_part_num' => 'mft_part_num',

                    'list_price' => 'list_price',

                    'cost_price' => 'cost_price',

                    'discount_price' => 'discount_price',

                    'list_usdollar' => 'list_usdollar',

                    'cost_usdollar' => 'cost_usdollar',

                    'discount_usdollar' => 'discount_usdollar',

                    'tax_class' => 'tax_class',

                    'weight' => 'weight',

                    'type_id' => 'type_id',

                    'type_name' => 'type_name',

                    'manufacturer_id' => 'manufacturer_id',

                    'manufacturer_name' => 'manufacturer_name',

                    'currency_id' => 'currency_id',

                    'base_rate' => 'base_rate',

                    'your_custom_product_field_c' => 'your_custom_catalog_field_c',

                    );

     

    HTH

    FrancescaS

Children
No Data