SugarCRM 7.9 Quotes
I have a dynamic multi-select in Products, the items are retrieved appropriately and the dropdown values display and are selectable. However, when I save, the selected values are not saved in the database although there are no errors in the sugar log, the php log or the console.
custom/modules/Products/clients/base/fields/enum/enum.js
({
extendsFrom: 'EnumField',
initialize: function(options){
this._super('initialize',[options]);
},
_render:function(){
this._super('_render');
},
//this is also triggered by an on-change event on the ProductBundleQuoteDataGroupListView
loadEnumOptions: function(fetch, callback){
var self = this;
if(self.name == 'discounts_c'){
this.isFetchingOptions = true;
this.items = {};
var currency_id = this.model.get('currency_id'),
part_num = this.model.get('mft_part_num'),
discount_url = app.api.buildURL('ERPDiscountProgramsLookup/'+part_num+'/'+currency_id);
app.api.call('GET', discount_url, null, {
success: function (data){
if(!_.isEmpty(data)){
var discounts = JSON.parse(data);
_.each(discounts, function(val){
self.items[val] = val; //set the individual items for the dropdown
});
}
self.isFetchingOptions = false;
callback.call(self);
},
error: function(e){
self.isFetchingOptions = false;
console.log(e);
},
});
}else self._super('loadEnumOptions', [fetch, callback]);
},
_dispose: function() {
this._super('_dispose');
}
})
Any thoughts on why it won't save the selected values?
Thanks,
Francesca