Selecting quote line items from intelligence pane catalog does not trigger on change event on mft_part_num

In Quotes I have an on-change event on ProductsQuoteDataRelateField to set price and tax from an ERP.

custom/modules/Products/clients/base/fields/quote-data-relate/quote-data-relate.js

({
  extendsFrom:'ProductsQuoteDataRelateField',
  initialize: function(options){
    this._super('initialize', [options]);
    this.model.on('change:mft_part_num', this.triggerERPLookup,this); //takes care of user-added/modified lines
  },
  triggerERPLookup: function(){
    //do the lookup and set tax and price for the line item
  }
})

But this does not trigger when the user selects the product using the product catalog dashlet.

Any suggestions on how to trigger the same logic when the product catalog dashlet is used?

thanks,
FrancescaS

Parents
  • Hi Francesca Shiekh 

    By adding an Item from Product Catalog Dashlet it will create an entire new model and add it into a new row, so no event is triggered, but you can track/listen that by extending the method _onProductCatalogDashletAddItem from modules/Quotes/clients/base/layouts/quote-data-list-groups/quote-data-list-groups.js.

    Regards

    André Lopes
    Lampada Global
    Skype: andre.lampada
  • Actually you may need to extend the method onAddNewItemToGroup from modules/ProductBundles/clients/base/views/quote-data-group-list/quote-data-group-list.js once the previous I mentioned is a private one.

    In this case you need to decide whether to invoke the ERP integration from inside this extended method if product_template_id is populated as per variable prepopulateData.

    Good luck!

    André Lopes
    Lampada Global
    Skype: andre.lampada
  • Thank you André Lopes, I am "playing" with it now, I'll let you know how it goes.

Reply Children
No Data