How to add selectable Quoted Line item history to Quotes?

Currently in the Quotes module (V12.0 ENT) There are 3 mechanisms to add a Product to a quote

  • Product field on new line items
  • Product catalog dahlet
  • Product catalog Quick picks Dashlet

What I'm trying to accomplish is add a custom dashlet, extend the current Quick picks dashlet to include QLI history or even add a custom drawer.  

I need to be able to show QLI history based on the billing_account_id and have it work the same as Product Catalog Items.  When adding to the quote, it would carry the historical cost etc.

Has anyone accomplished this?  In Sugar 7-7.7 this was very easy to do.  Having a tough time adding this to sidecar.  

Parents
  • Ok so I'm getting close, need a nudge here.  Attempting the Custom Drawer route.  This actually works perfectly (almost).  Here's what I'm doing.  Its VERY close to the functionality I want, but maybe there's an easier/better way to do this?

    I've added a custom button to the action view:

    https://support.sugarcrm.com/Knowledge_Base/Studio_and_Module_Builder/Creating_an_Action_Button/

    Then on click event, I'm calling a custom function that 

    • Makes an API call to #Products (Quoted Line Items) with a filter of the current quotes 'billing_account_id'
    • Create a bean collection of all returned results
    • Use that bean collection to populate a selection list drawer
    • added a callback function to actually do something with the returned result, but just console logging for now.

    There are 2 problems:

    1. The returned API results are correct but there are 60K records for the account I'm testing so its taking FOREVER to load the list view inside the drawer
    2. The drawer search bar and filters dont work.  

    Here's my full code.  Anyone have any ideas?  Am I over complicating this?  Or am I mixing some parameters and it just kinda happens to look almost perfect?

    _show_history: function() 
    	{
    		account_id = this.model.get("billing_account_id");
    		parentModel = this.model, 
    		  
              linkModule = 'Products'; 
    			
              linkModel = app.data.createBean(linkModule); 
    		  var url = app.api.buildURL(linkModule, null, null, {
                    'filter'    : [{
                        'account_id'  : account_id
                    }]
                });
    			  app.api.call('GET', url, null, {
    				success:function(data){
    				  products = app.data.createBeanCollection("Products",data['records']);
    				  app.drawer.open({
    					layout: 'selection-list',
    					context: { 
    					   module: linkModule,
    					   model: linkModel,
    					   parentModel: parentModel,
    					   collection:products,
    					   filterOptions:{
    						 stickiness:false,
    						 auto_apply:false,
    					   },
    					}
    				  }, function(selectedModel) {
    					   if (!_.isEmpty(selectedModel)) {
    						  console.log("We did it!");  // Handle the callback later to add item to Quote
    					   }
    				  });
    				},
    				error:function(e){
    				  console.log(e);
    				},
    			  });
    			
    	},

Reply
  • Ok so I'm getting close, need a nudge here.  Attempting the Custom Drawer route.  This actually works perfectly (almost).  Here's what I'm doing.  Its VERY close to the functionality I want, but maybe there's an easier/better way to do this?

    I've added a custom button to the action view:

    https://support.sugarcrm.com/Knowledge_Base/Studio_and_Module_Builder/Creating_an_Action_Button/

    Then on click event, I'm calling a custom function that 

    • Makes an API call to #Products (Quoted Line Items) with a filter of the current quotes 'billing_account_id'
    • Create a bean collection of all returned results
    • Use that bean collection to populate a selection list drawer
    • added a callback function to actually do something with the returned result, but just console logging for now.

    There are 2 problems:

    1. The returned API results are correct but there are 60K records for the account I'm testing so its taking FOREVER to load the list view inside the drawer
    2. The drawer search bar and filters dont work.  

    Here's my full code.  Anyone have any ideas?  Am I over complicating this?  Or am I mixing some parameters and it just kinda happens to look almost perfect?

    _show_history: function() 
    	{
    		account_id = this.model.get("billing_account_id");
    		parentModel = this.model, 
    		  
              linkModule = 'Products'; 
    			
              linkModel = app.data.createBean(linkModule); 
    		  var url = app.api.buildURL(linkModule, null, null, {
                    'filter'    : [{
                        'account_id'  : account_id
                    }]
                });
    			  app.api.call('GET', url, null, {
    				success:function(data){
    				  products = app.data.createBeanCollection("Products",data['records']);
    				  app.drawer.open({
    					layout: 'selection-list',
    					context: { 
    					   module: linkModule,
    					   model: linkModel,
    					   parentModel: parentModel,
    					   collection:products,
    					   filterOptions:{
    						 stickiness:false,
    						 auto_apply:false,
    					   },
    					}
    				  }, function(selectedModel) {
    					   if (!_.isEmpty(selectedModel)) {
    						  console.log("We did it!");  // Handle the callback later to add item to Quote
    					   }
    				  });
    				},
    				error:function(e){
    				  console.log(e);
    				},
    			  });
    			
    	},

Children
No Data