Why does populate_list does not work on initial product select in the Product Catalog Dashlet?

Hi Everyone,

I had a small query/issue when working on the Quotes creation with the Product Catalog Dashlet. In Sugar 10.2/Sugar 10.3 when we are creating a quote we have quoted line items where the data gets populated on selecting the Product from Product Catalog Dashlet. By default, it copies all stock field data from the Product Catalog to the Quoted line item. When we want to add any custom field in Quoted Line Item and that also to be copied, I have used the populate list function

So we have added the custom field in the quoted line item and added the below code in the Vardefs file.

$dictionary['Product']['fields']['product_template_name']['populate_list']['fieldfromProductCatalog']='fieldnameinQLI';

Note: Want to copy stock field data of Product Catalog to Custom field in QLI.

But this works only when we are searching and selecting the Product in the QLI or change of Product name. But it does not work when we pick the Product from Product Catalog Dashlet to QLI initially. 

Can anyone of the Community people suggest how can we achieve this.

Many Thanks in Advance:)

Poojitha K

  • Product Catalog dashlet doesn't work the same way GRID selection does.

    GRID selection definitely loads populate_list once product_template_name is updated by the user.

    In another hand Product Catalog dashlet bulk send all predefined fields at once to method onAddNewItemToGroup of js controller BaseProductBundlesQuoteDataGroupListView through event 'quotes:group:create:qli', this way events on product_template_name will not be triggered.

    Actually the cascading of events is:

    1. QuotesProductCatalogView._sendItemToRecord send data from selected Product Catalog to event productCatalogDashlet:add
    2. productCatalogDashlet:add is listened by BaseQuotesQuoteDataListGroupsLayout._onProductCatalogDashletAddItem
    3. BaseQuotesQuoteDataListGroupsLayout._onProductCatalogDashletAddItem send modified data to event quotes:group:create:qli
    4. quotes:group:create:qli is listened by BaseProductBundlesQuoteDataGroupListView.onAddNewItemToGroup
    5. BaseProductBundlesQuoteDataGroupListView.onAddNewItemToGroup create new QLI and add all data at once, avoiding events on product_template_name.

    The best approach is to extends BaseQuotesQuoteDataListGroupsLayout._onProductCatalogDashletAddItem in order to populate data with fields which should had been populated by populate_list and finaly call parent method.

    Good luck!

    André Lopes
    Lampada Global
    Skype: andre.lampada