AnsweredAssumed Answered

passing data to RLI subpanel in Opp create

Question asked by Michiel Mobach on Feb 23, 2017
Latest reply on Feb 24, 2017 by Francesca Shiekh

I want to define in the opportunity what kind it is by defining a "type" and "category", Both of them are dropdowns, and made category dependant to type. In order to easily find data in the product catalog we did the same thing. In the

 

Revenue Line Items i made a dependancy on these two fields. In order to find the right associated products i defined a filter sending the data to only get the right product list. 

 

If the opportunity is saved, it works. You can add a RLI and find the right products. But in create view it doesn't. I have tried it with setting triggers and (in record.js) and the collecting a response (in subpanel-opportunities-create.js) Like:

 

trigger:

({

   extendsFrom : 'CreateView',

   initialize : function(options) {

         this._super('initialize', [ options ]);

   },

   bindDataChange : function() {

         this._super('bindDataChange');

         this.model.on('change:product_category_c', this.PassData, this);

   },

   PassData : function (){

         var prod_category = this.model.get('product_category_c');

         var prod_type = this.model.get('product_type_c');

         var category_type = prod_category + "_" + prod_type;

         this.context.trigger("passdata_from_opp_to_rli", category_type);  

   }

})

 

 

response:

({

    extendsFrom: 'SubpanelForOpportunitiesCreate',

    initialize : function(options) {

         this._super('initialize', [ options ]);

         this.context.on('passdata_from_opp_to_rli', this.PassD, this);

   },

   PassD : function(category_type) {

         this.model.set('parent_category_type_c', category_type);

   }

})

 

Problem is this does't work somehow.

Anybody any suggestions?

Outcomes