New quotes modules How to update the current QLI based on field change?

Hi All,

We are moving old quote customisation to new quotes module in 7.9.4.

When quantity is changed, we need to update a custom filed for that specific QLI.

How/where to update the specific QLI only, based on the field change?

Any body has any idea how we can achieve that.

Regards,

Usman

Parents
  • I make some field dependent changes in:

    <mysugar>/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(){
        //my ERP price lookup updates discount_price when the mft_part_num changes
      },
    })

    Maybe this will work for you too.

    FrancescaS

Reply
  • I make some field dependent changes in:

    <mysugar>/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(){
        //my ERP price lookup updates discount_price when the mft_part_num changes
      },
    })

    Maybe this will work for you too.

    FrancescaS

Children
  • hey Francesca Shiekh,

    really appreciate your generously sharing your knowledge. This is exactly what make the community helpful.

    as you know by default, when quantity / product template / unit price /  discount those fields change, there is already some event triggered to render the page. my question is, do you know what and where is that event ? and how to extend that event to add some custom handling? If i add 

    this.model.on('change:mft_part_num', this.triggerERPLookup,this);

    for each fields, would it override the default event?  I have also found another related article: How/where to detect this change event for product change in new quote module 7.9.4  which seems have totally different solution. however, i could not get it. what do you think about that?

    our user case is, when a product template get picked/changed, we would like to call custom API to calculate the UNIT price and send back to UI. Could you please give any advise? 

    looking forward to hear back from you.

    cheers,

    Rob